> I think it would be great if Python were the first real adopter of this
> convention...
A convention without any adopters? Seems like a non sequitur...
___
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-
On Tue, Apr 29, 2008 at 8:42 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 29, 2008 at 8:10 PM, Tim Heaney <[EMAIL PROTECTED]> wrote:
> > Speaking of this, is it too late to lobby for an iterator version of
> > os.listdir? (Perhaps listdir would not be the best name. :)
> >
> >
David Pokorny wrote:
> With all due respect, the policy you
> describe---a more efficient implementation in the common
> case---optimizes the code of people who don't think about this issue
> at all. In other words it facilitates premature optimization.
So automatically making the most common
Martin v. Löwis" wrote:
> Are you implying that the search is faster for a tuple if the set is
> small?
That was my intuition but the measurements say otherwise. ;) Even for
sets as small as two or three elements, searches in frozensets are
faster than within tuples. See my tuple vs. frozenset
Guido wrote:
> (I suspect for a 2-element set of ints or strings, translating "x in
> {C1, C2}" into "x in (C1, C2)" might actually be a slight win since
> probing a tuple must be much faster than probing a set; but that's a
> detail.)
A trivial but hopefully fairly representative benchmark:
Act
On Jan 24, 2008 4:23 PM, Barry Warsaw wrote:
> On Jan 24, 2008, at 7:12 PM, Raymond Hettinger wrote:
>
> >> Looking over the code base, frozensets are used rarely.
> >> So I don't think this is warranted.
> >
> > There is no shortage for perfect use cases in the form:
> >
> > if urlext in {'html
On Jan 11, 2008 11:16 AM, Aahz <[EMAIL PROTECTED]> wrote:
> On Fri, Jan 11, 2008, Raymond Hettinger wrote:
> >
> > I proposed to remove three methods from the queue module, qsize(),
> > empty(), and full(). These are not reliable. The RightWay (tm) is to
> > trap the Empty and Full exceptions or