Re: [Python-3000] packages in the stdlib

2006-06-02 Thread Aaron Bingham
Terry Reedy wrote: >"Aaron Bingham" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] > > >>I'm confused. As far as I can see, a reserved prefix (the "py" or >>"stdlib" package others have mentioned) is the only reliable way to >>avoid naming conflicts with 3rd-party packages with a

Re: [Python-3000] packages in the stdlib

2006-06-02 Thread Gareth McCaughan
On Thursday 2006-06-01 22:16, Mike Klaas wrote: > Terry Reedy wrote: > > Because you have to type it over and over. > > hmm, With the right context manager: > > import py > with py as py: > from gui import tkinker > import net > with net as net: > import httplib > imp

Re: [Python-3000] weakrefs and cyclic references

2006-06-02 Thread Nick Coghlan
Greg Ewing wrote: > What might be useful is an easier way of *explicitly* > creating and using weak references. > > We already have WeakKeyDictionary and WeakValueDictionary > which behave just like ordinary dicts except that they > weakly reference things. I'm thinking it would be nice > to have

Re: [Python-3000] weakrefs and cyclic references

2006-06-02 Thread tomer filiba
dang, you posted before me :) anyway, please check my implementation as well http://sebulba.wikispaces.com/recipe+weakattr i also included some demos. anyway, i'd like to have this or the other weakattr implementation included in weakref.py. it's a pretty useful feature to have in the stdlib, fo

Re: [Python-3000] Using a list for *args (was: Type annotations:annotating generators)

2006-06-02 Thread Collin Winter
On 6/1/06, Michael Chermside <[EMAIL PROTECTED]> wrote: > Collin Winter writes: > > I've attached the benchmarks as a comment on the patch, but I'll > > repeat them here. All times are usecs per loop. > [statistics showing list is about 15% slower] > > My memory is fuzzy here. Can someone rep

Re: [Python-3000] packages in the stdlib

2006-06-02 Thread Talin
Ronald Oussoren wrote: > On 1-jun-2006, at 17:44, Brett Cannon wrote: >>I suppose that's at least partially not an issue at the moment >>because you can only add stuff to existing packages through hacks. I >>wouldn't touch libraries that inject themselves into existing >>packages through .pth hacke

Re: [Python-3000] packages in the stdlib

2006-06-02 Thread Brett Cannon
On 6/2/06, Talin <[EMAIL PROTECTED]> wrote: Ronald Oussoren wrote:> On 1-jun-2006, at 17:44, Brett Cannon wrote:>>I suppose that's at least partially not an issue at the moment>>because you can only add stuff to existing packages through hacks. I >>wouldn't touch libraries that inject themselves in

Re: [Python-3000] packages in the stdlib

2006-06-02 Thread Terry Reedy
"Aaron Bingham" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >[me] >>For the latter (2 above), I think those who want such mostly agree in >>principle on a mostly two-level hierarchy with about 10-20 short names >>for >>the top-level, using the lib docs as a starting point for the

Re: [Python-3000] packages in the stdlib

2006-06-02 Thread Jim Jewett
On 6/2/06, Talin <[EMAIL PROTECTED]> wrote: > ... it seems to me that there is a cross-linkage > between the "reorganize standard library" task and the "refactor import > machinery" task Eventually, yes. As Brett pointed out, "reorganize the standard library" stands on its own, and is intended t

Re: [Python-3000] a slight change to __[get|set|del]item__

2006-06-02 Thread tomer filiba
Guido wrote: > Because the (...) in a function call isn't a tuple. > > I'm with Oleg -- a[x, y] is *intentionally* the same as a[(x, y)]. > This is a feature; you can write > >t = x, y# or t = (x, y) > > and later > > a[t] well is func((1,2,3)) the same as func(1,2,3)? no. so why should

[Python-3000] have iter(mapping) generate (key, value) pairs

2006-06-02 Thread Steven Bethard
I'd like to suggest that we (at least briefly) re-consider the decision that iterating over a mapping generates the keys, not the (key, value) pairs. This was addressed somewhat in `PEP 234`_, with the pros and cons basically being: * From a purity standpoint, iterating over keys keeps the symmet

Re: [Python-3000] have iter(mapping) generate (key, value) pairs

2006-06-02 Thread Guido van Rossum
This was already considered and rejected. See PEP 3099. On 6/2/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > I'd like to suggest that we (at least briefly) re-consider the > decision that iterating over a mapping generates the keys, not the > (key, value) pairs. This was addressed somewhat in `

Re: [Python-3000] have iter(mapping) generate (key, value) pairs

2006-06-02 Thread Michael Chermside
Steven Bethard writes: > I'd like to suggest that we (at least briefly) re-consider the > decision that iterating over a mapping generates the keys, not the > (key, value) pairs. I agree, now is the best time for reconsidering the decision. My opinion on the matter itself is that I was unsure bef

Re: [Python-3000] have iter(mapping) generate (key, value) pairs

2006-06-02 Thread Nick Coghlan
Steven Bethard wrote: > Note that even though the `Language Reference`_ defines mappings in > terms of __len__, __getitem__, __setitem__, __delitem__ and __iter__, > UserDict.DictMixin.update has to assume that all mappings have a > .keys() method. A slightly different proposal: Add an iteritems(