][0]
x, = res # I didn't think of this one before recently
Are all answers, but none of them I would consider *obvious*.
And from my SQL-hacking experience:
x = min(s)
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Raymond Hettinger wrote:
[Scott David Daniels]
I find I have a need in randomized testing for a shorter version
of getstate, even if it _is_ slower to restore. [blah about big state]
Sounds like you could easily wrap the generator to get this.
It would slow you down but would give
overlooked? Is there a better forum
in which to ask this question?
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
back on the patch.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
correctly, the default csv dialect is just the Excel dialect, so
this would be two different ways of saying the same things.
Right, but Guido's point is, decide which one is the is the definition
and stick to talking about it in that form.
--Scott David Daniels
scott.dani...@acm.org
setup.py uninstall some_package
Then explicitly say so for us poor schlubs.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org
packagers to actually
come to a hard decision. If you want approval either admit you have no
solution in the PEP (and detail the issues that prevent a decision),
provide a minimally acceptable command, or expect that nobody sees the
value of what you propose
--Scott David Daniels
scott.dani
is the only one of the four I checked; I suspect
the other three are similarly mislabeled.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
+1
on this proposal with Greg's modification.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python
with:
1157920892373161954235709850086879078532699846656405640e+23
or 115792089237316195423570985008687907853269984665640564.0e+24
or some such, rather than
1.157920892373162e+77
or 1.15792089237316195423570985008687907853269984665640564e+77
--Scott David Daniels
scott.dani...@acm.org
Mark Dickinson wrote:
On Sun, Apr 26, 2009 at 8:11 PM, Scott David Daniels
scott.dani...@acm.org wrote:
As a user of Idle, I would not like to see the change you seek of
having %f stay full-precision. When a number gets too long to print
on a single line, the wrap depends on the current
ark Dickinson wrote:
On Sun, Apr 26, 2009 at 10:42 PM, Scott David Daniels wrote:
...
I had also said (without explaining:
only the trailing zeroes with the e, so we wind up with:
1157920892373161954235709850086879078532699846656405640e+23
and more surprising thing. We do
at least have
('1' + '2') + '3' == '1' + ('2' + '3')
But we don't have:
(1e40 + -1e40) + 1 == 1e40 + (-1e40 + 1)
Non-associativity is what makes for floating point headaches.
To my knowledge, floating point is at least commutative.
--Scott David Daniels
to strip whitespace off the end of lines as
information-destroying.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
Nick Coghlan wrote:
Collin Winter wrote:
That would be a bikeshed discussion of such
magnitude, you'd have to invent new colors to paint the thing.
Octarine. Definitely octarine :)
I'm not so sure of the color itself, but its name should definitely
rhyme with orange.
--Scott David Daniels
are looking for). In any case, even a charter of unit tests to 50%
coverage of Idle would be a huge improvement.
I've run after specific bugs in Idle, but don't really know the lay of
the land.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev
for a single file should probably push back out to a full sync. This
would be trickier to accomplish if the using code had to suss out how
to get to the fp. Clearly I have plans for a ZipFile expansion, but
this could only conceivably hit 2.7, and 2.8 / 3.2 is a lot more likely.
--Scott David
be worth while here?
But you must decide if what you want really does LRU -- does accessing
the oldest entry make it the most recent entry?
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http
I need?
* Bazaar 1.0 or newer. As of this writing (04-Nov-2008) Bazaar 1.8
is the most recent release. As Bazaar is written in Python (yay!),
it is available for all major platforms, See the Bazaar home page
for information about versions for your platform.
--Scott David Daniels
Christian Heimes wrote:
... The performance penalty is slime to nothing for the common case
Sorry, I love this typo.
-Scott
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
that (may have to chase chains of
**kwarg-passing functions), but even hard to document.
So, I'd avoid it.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
overwrite **
20K modify one unit at a time 0.296 0.0721.320 4.09 18.26
400K modify 20 units at a time 5.690 1.360 22.500 4.18 16.54
400K modify 4096 units at a time 151.000 88.300 509.000 1.71 5.76
--Scott David Daniels
scott.dani...@acm.org
) for p in paths]))
give '/a', not '/a/b'.
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
/c.d/e'f', r'a\b\c.d\eve'], delimited=True)
return either
'a/b/c.d'
or r'a\b\c.d'
Perhaps even ['a', 'b', 'c.d'] (suitable for os.path.join).
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http
[number_to_hold]
...
--Scott David Daniels
scott.dani...@acm.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
and
warnings.showwarning. If you get it wrong, a deprecation warning can
prevent a module like md5 from loading (for example).
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Scott David Daniels wrote:
Match the new warning protocol exactly:
def showwarning(message, category, filename, lineno,
file=None, line=None):
...
If the line is not None, use it (which will happen if you pass it
along to showwarning
, and it looked
to me like this would accidentally swallow errors getting
warning context and make them fail silently. The Idle issue
that I'm fiddling with is that it doesn't take the new
showwarning call format, and it looked like this should
possibly be fixed at the same time.
--Scott David Daniels
[EMAIL
i = list(d)
is a more reasonable way to do this. I seldom find a reason
to use .keys
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
them where-
ever I am working without similar tests available.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
())
self.failure_exception(%(first)r %(op)r %(second): %(msg)
% vars())
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Ben Finney wrote:
Scott David Daniels [EMAIL PROTECTED] writes:
I would rather something more like:
def assert_compare_true(op, first, second, msg=None):
if op(first, second):
return
raise self.failure_exception(msg)
if msg is None
I just noticed that the bz2lib version was updated to 1.0.5 in December
of 2007, for security reasons. I suspect it would be good to be sure
to ship this with 2.6 or 3.0.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev
Alessandro Guido wrote:
Nick Coghlan wrote:
Eric Smith wrote:
Because None means 'use the default value'. You probably want:
print('a', 'b', sep='', end='')
I think this is a not optimally designed API
because you have to read the documentation to understand why
Excuse me, I don't know
Jeffrey Yasskin wrote:
The second returns the simplest rational within some distance. For
instance, it'll prefer 22/7 over 333/106 if both are close enough. We
might call it .simplest_within() for now. This seems useful for
converting from float and displaying results to users, where we prefer
of applications could:
A: cope with stupidly long path names.
V: cope with spaces in path names.
I bet they never intended to keep the huge names, just to make you cope
with them.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
this excerpt should show up in the
new developer area.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python
, there should be an indication of how much your box
must be opened up before you can log on, at least in the screen you
get to when you log on.
However, each time I went to enter such a note, I needed to log on.
I just gave up.
-Scott David Daniels
[EMAIL PROTECTED
behavior will be the correct one.
c) Given a filename, make an appropriately named associated file.
pyo_name = os.path.splitext(name)[0] + '.pyo'
This argues for os.path.splitext('.pythonrc') == ('.pythonrc','')
--
-- Scott David Daniels
[EMAIL PROTECTED
;
}
...
--
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Bob Ippolito wrote:
On 9/30/06, Scott David Daniels [EMAIL PROTECTED] wrote:
Christos Georgiou wrote:
Does anyone know why this happens? I can't find any information pointing to
this being deliberate.
Also note: the Os/X universal seems to include a Tix runtime for the
non-Intel
in the book,
and not everyone uses it.
...
Can't this just be enabled for platforms where it's known to work and let
Python as it currently is for the users of these legacy systems ?
Ah, but that _is_ the current state of affairs. .5 :-)
-- Scott David Daniels
[EMAIL PROTECTED
Rush Limbaugh was detained and questioned for transporting a possible
illegal Viagra prescription into the country.
Well... a least we know his back is feeling better.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev
Aahz wrote:
On Thu, Jun 29, 2006, Scott David Daniels wrote:
a quoted joke.
I'm hoping this was a typo of an e-mail address for sending, because
this is not appropriate for python-dev.
This absolutely was a matter of clicking the wrong spot. I completely
agree it would be inappropriate
, it will be 'turtle'.
Perhaps in the meantime (if xturtle is not loved),
you could go with turtle_ as in like the standard
turtle, but my definition.
--
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http
). So, reading your restrictions is
a capability I'd like to be able to control.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
Martin v. Löwis wrote:
Scott David Daniels wrote:
... if I remember the standard
correctly, the following code shouldn't complain:
PyObject_CallFunction((PyObject*) (void *) PyRange_Type,
lll, start, start+len*step, step)
You remember the standard incorrectly
code shouldn't complain:
PyObject_CallFunction((PyObject*) (void *) PyRange_Type,
lll, start, start+len*step, step)
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http
works, but yours does not.
--
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail
)
is True. More a document issue than anything, but to be considered.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
to be able to distinguish the two.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail
than a solid value proposition.
Trying to satisfy the profit-lust of angels has redirected more than one
company.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Chermside, Michael wrote:
... I will say that if there were no legacy I'd prefer the tounicode()
and tostring() (but shouldn't itbe 'tobytes()' instead?) names for Python 3.0.
Wouldn't 'tobytes' and 'totext' be better for 3.0 where text == unicode?
--
-- Scott David Daniels
[EMAIL PROTECTED
)) * relative_tol)
I use =, since zero-tolerance should pass equal values.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org
libs = glob.glob(os.path.join(lib_dir, *s.o))
==
lib_dir = Path(/lib)
libs = lib_dir.files(*.so)
Probably that should be:
...
libs = glob.glob(os.path.join(lib_dir, *.so))
...
--Scott David Daniels
[EMAIL PROTECTED
and other weird formats, as
well as providing decimal conversion into some unicode number ranges
outside the ASCII group.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python
Fred L. Drake, Jr. wrote:
Scott David Daniels wrote:
Would expect_fail, expect_failure, expected_fail, or
expected_failure, work for you?
None of these use the same naming convention as the other unittest object
attributes. Perhaps something like failureExpected?
I'd definately
function in unittest.
Here is where the recipe is, for those who want to comment further:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466288
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http
Fredrik Lundh wrote:
Scott David Daniels wrote:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466288
my main nit is the name: the test isn't broken in itself, and doesn't need
to be fixed; it's just not expected to succeed at this time.
the usual term for this is expected
...
Or, perhaps:
class _Quitter(str):
def __call__(self): raise SystemExit
quit = _Quitter('The quit command. Type quit() to exit')
exit = _Quitter('The exit command. Type exit() to exit')
--Scott David Daniels
[EMAIL PROTECTED
for debugging
and output.
Tell me:
a = [0] * 3
b = [0] * 3
a[0] = b
b[0] = a
What order should a and b have?
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python
off the same node of the PYTHONPATH.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
security principles.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Michael Chermside wrote:
... a meme will spread which says (and PLEASE don't quote this!)
ElementTree has a great API, but it's just too slow for real work.
+1 DNQOTW :-) (Do Not Quote Of The Week)
--Scott David Daniels
[EMAIL PROTECTED]
___
Python
ineffective and annoying. For example,
distutils.msvccompiler uses a bunch of instance variables which would I
would like to access in a subclass, but are unavailable because the
author could not imagine why I would need them.
--Scott David Daniels
[EMAIL PROTECTED
Jeremy Hylton wrote:
On 12/12/05, Scott David Daniels [EMAIL PROTECTED] wrote:
Perhaps The __ name convention is designed for 'mixins'; as a means of
enforcing private it is both ineffective and annoying. For example,
distutils.msvccompiler uses a bunch of instance variables which would I
://members.dsl-only.net/~daniels/dist/to_int-0.10.win32.zip
Sources:
http://members.dsl-only.net/~daniels/dist/to_int-0.10.zip
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
Well, wouldn't you know it.
I get the code right and mess up the directions.
Scott David Daniels wrote:
if you build this module, I'd suggest using
from to_int import chomp to get a function that works like int
(producing a long when needed and so on).
Well, actually it is a bit more than
Michael Hudson wrote:
How does a copying gc differ much from a non-copying non-refcounted gc
here?
One important issue for C coded modules is that addresses may change
when a GC is invoked, so no remembering addresses in your module; you
must recalculate before each use.
-- Scott David
data
sources unnecessarily inefficient.
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
or SystemExit.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
dynamic blocks with no distance codes
* Fix crc check bug in gzread() after gzungetc()
* Do not return an error when using gzread() on an empty file
I'd guess this belongs in 2.5, with a possible retrofit for 2.4.
--Scott David Daniels
[EMAIL PROTECTED
[EMAIL PROTECTED] wrote:
... if Py3k ever happens, I'd hope that it would be the *one* Python
to use -- too many incompatibilities would probably mean *two*
Pythons fighting each other).
A caduceus to heal software problems?
http://www.pantheon.org/articles/c/caduceus.html
--Scott David
Michael Hudson wrote:
Gary Robinson [EMAIL PROTECTED] writes:
... bus error 100% of the time ...:
We've boiled it down pretty far, and I've sent him off to
the mac-python folks (looks gcc-compilerish to me, or maybe
fallout from slight changes in C function call semantics).
--Scott David
has been rejected, the trailing L no longer introduces
ambiguity in the representation of roman(40) vs. roman(10L).
--Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python
);
+ return NULL;
+ }
return PyFloat_FromDouble(dx);
}
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
Should loads raise an exception?
Somehow, I thing 1.0 is not the best possible representation for +Inf.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
Brett C. wrote:
... I figured I would take up the idea. So hear
^^ here ^^
we go.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
for the app I was fiddling with) decorating at the top
of declaration helps show the purpose of the class.
Have a look at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393010
and see what you think.
-- Scott David Daniels
[EMAIL PROTECTED
document with no real content. Really, the twenty two pages
included an introduction, conclusion, table of contents, appendix,
and index. It just didn't have anything but section headings. It
was a thrilling triumph of form over function; a real Suahuab
aesthetic, to coin a term.
--Scott David Daniels
final summary
could be a personal view of PyCon for those of us unable to get there.
If you make no more contribution to Python than you have so far, you
will have done us a great service.
Hip-hip-hooray-ly y'rs
--Scott David Daniels
[EMAIL PROTECTED
believe our current policy is that the author
warrants that the code is his/her own work and not encumbered by
any patent.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo
Brett C. wrote:
Scott David Daniels wrote:
I'm hoping to add BZIP2 compression to zipfile for 2.5. My primary
motivation is that Project Gutenberg seems to be starting to use BZIP2
compression for some of its zips. What other wish list things do
people around here have for zipfile? I thought
open a pseudo-file for STORED files in binary read mode, for
example, to allow reading zip-in-zip files without fully occupying
memory.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org
Josiah Carlson wrote:
Scott David Daniels [EMAIL PROTECTED] wrote:
I'm hoping to add BZIP2 compression to zipfile for 2.5. My primary
motivation is that Project Gutenberg seems to be starting to use BZIP2
compression for some of its zips. What other wish list things do
people around here have
.
-- Scott David Daniels
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
87 matches
Mail list logo