Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-23 Thread Greg Ewing
Thomas Wouters wrote: > On Thu, Feb 23, 2006 at 05:25:30PM +1300, Greg Ewing wrote: > >>As an aside, is there any chance that this could be >>changed in 3.0? I.e. have the for-loop create a new >>binding for the loop variable on each iteration. > > You can't do that without introducing a whole new

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Greg Ewing
Thomas Wouters wrote: > __methods__ are methods that should only be > called 'magically', or by the object itself. > 'next' has quite a few usecases where it's > desireable to call it directly That's why the proposal to replace .next() with .__next__() comes along with a function next(obj) whic

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Greg Ewing
Michael Chermside wrote: > The next() method of iterators was an interesting > object lesson. ... Since it was sometimes invoked by name > and sometimes by special mechanism, the choice was to use the > unadorned name, but later experience showed that it would have been > better the other way. Any

Re: [Python-Dev] OT: T-Shirts

2006-02-23 Thread Alex Martelli
On Feb 23, 2006, at 6:12 PM, Facundo Batista wrote: > Python Argentina finally have T-Shirts (you can see a photo here: > http://www.taniquetil.com.ar/plog/post/1/161). > > Why this mail to python-dev? Because the group decided to give some, > as a present, to some outstanding members of Python:

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Michael Chermside
Walter Dörwald writes: > I always thought that __magic__ method calls are done by Python on > objects it doesn't know about. The special method name ensures that it > is indeed the protocol Python is talking about, not some random method > (with next() being the exception). In the defaultdict case

[Python-Dev] OT: T-Shirts

2006-02-23 Thread Facundo Batista
Python Argentina finally have T-Shirts (you can see a photo here: http://www.taniquetil.com.ar/plog/post/1/161). Why this mail to python-dev? Because the group decided to give some, as a present, to some outstanding members of Python: Guido van Rossum Alex Martelli Tim Peters Fredrik Lund

Re: [Python-Dev] bytes.from_hex()

2006-02-23 Thread Greg Ewing
Stephen J. Turnbull wrote: > Please define "character," and explain how its semantics map to > Python's unicode objects. One of the 65 abstract entities referred to in the RFC and represented in that RFC by certain visual glyphs. There is a subset of the Unicode code points that are conventionall

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Walter Dörwald
Guido van Rossum wrote: > On 2/22/06, Michael Chermside <[EMAIL PROTECTED]> wrote: >> A minor related point about on_missing(): >> >> Haven't we learned from regrets over the .next() method of iterators >> that all "magically" invoked methods should be named using the __xxx__ >> pattern? Shouldn't

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Thomas Wouters
On Wed, Feb 22, 2006 at 01:13:28PM -0800, Michael Chermside wrote: > Haven't we learned from regrets over the .next() method of iterators > that all "magically" invoked methods should be named using the __xxx__ > pattern? Shouldn't it be named __on_missing__() instead? I agree that on_missing sho

Re: [Python-Dev] getdefault(), the real replacement for setdefault()

2006-02-23 Thread Thomas Wouters
On Wed, Feb 22, 2006 at 10:29:08PM -0500, Barry Warsaw wrote: > d.getdefault('foo', list).append('bar') > Anyway, I don't think it's an either/or choice with Guido's subclass. > Instead I think they are different use cases. I would add getdefault() > to the standard dict API, remove (eventually)

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-23 Thread Thomas Wouters
On Thu, Feb 23, 2006 at 05:25:30PM +1300, Greg Ewing wrote: > Samuele Pedroni wrote: > > > If you are looking for rough edges about nested scopes in Python > > this is probably worse: > > > > >>> x = [] > > >>> for i in range(10): > > ... x.append(lambda : i) > > ... > > >>> [y() for y in x]

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Guido van Rossum
On 2/22/06, Michael Chermside <[EMAIL PROTECTED]> wrote: > A minor related point about on_missing(): > > Haven't we learned from regrets over the .next() method of iterators > that all "magically" invoked methods should be named using the __xxx__ > pattern? Shouldn't it be named __on_missing__() in

Re: [Python-Dev] Path PEP: some comments (equality)

2006-02-23 Thread Chris AtLee
On 2/20/06, Mark Mc Mahon <[EMAIL PROTECTED]> wrote: > Hi, > > It seems that the Path module as currently defined leaves equality > testing up to the underlying string comparison. My guess is that this > is fine for Unix (maybe not even) but it is a bit lacking for Windows. > > Should the path clas

Re: [Python-Dev] Using and binding relative names (was Re: PEP for Better Control of Nested Lexical Scopes)

2006-02-23 Thread Steven Bethard
On 2/22/06, Almann T. Goo <[EMAIL PROTECTED]> wrote: > Since the current semantics allow *evaluation* to an enclosing scope's > name by an "un-punctuated" name, "var" is a synonym to ".var" (if > "var" is bound in the immediately enclosing scope). However for > *re-binding* to an enclosing scope's

Re: [Python-Dev] Using and binding relative names (was Re: PEP for Better Control of Nested Lexical Scopes)

2006-02-23 Thread Georg Brandl
Phillip J. Eby wrote: > At 03:49 PM 2/23/2006 +1300, Greg Ewing wrote: >>Steven Bethard wrote: >> > And, as you mention, it's consistent >> > with the relative import feature. >> >>Only rather vaguely -- it's really somewhat different. >> >>With imports, .foo is an abbreviation for myself.foo, >>w

Re: [Python-Dev] Pre-PEP: The "bytes" object

2006-02-23 Thread Jason Orendorff
On 2/22/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote:     @classmethoddef fromhex(self, data):data = "" '', data)return bytes(binascii.unhexlify(data))If it's to be a classmethod, I guess that should be "return self( binascii.unhexlify(data))".-j __

Re: [Python-Dev] buildbot, and test failures

2006-02-23 Thread skip
Christos> This isn't feasible, though, so in case we add more Linux Christos> machines, at least make sure that the libc/gcc combo is not Christos> one already used in the existing ones. Maybe include libc/gcc versions in the name or description? Skip

Re: [Python-Dev] buildbot, and test failures

2006-02-23 Thread Christos Georgiou
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Anthony Baxter wrote: >> I >> have an Ubuntu x86 box here that can become one (I think the only >> linux, currently, is Gentoo...) > > How different are the Linuxes, though? How many of them do we need? Actually, w

Re: [Python-Dev] defaultdict proposal round three

2006-02-23 Thread Fuzzyman
Greg Ewing wrote: Fredrik Lundh wrote: fwiw, the first google hit for "autodict" appears to be part of someone's link farm At this website we have assistance with autodict. In addition to information for autodict we also have the best web sites concerning dictionary,

Re: [Python-Dev] calendar.timegm

2006-02-23 Thread Donovan Baarda
On Tue, 2006-02-21 at 22:47 -0600, [EMAIL PROTECTED] wrote: > Sergey> Historical question ;) > > Sergey> Anyone can explain why function timegm is placed into module > Sergey> calendar, not to module time, where it would be near with > Sergey> similar function mktime? > > Historic