Re: [Python-Dev] code blocks using 'for' loops and generators

2005-03-16 Thread Josiah Carlson
Greg Ewing [EMAIL PROTECTED] wrote: Josiah Carlson wrote: Since PEP 310 was already mentioned, can we just say that the discussion can be boiled down to different ways of spelling __enter__/__exit__ from PEP 310? It's not quite the same thing. PEP 310 suggests a mechanism with a

[Python-Dev] itertools.walk()

2005-03-16 Thread Raymond Hettinger
Some folks on comp.lang.python have been pushing for itertools to include a flatten() operation. Unless you guys have some thoughts on the subject, I'm inclined to accept the request. Rather than calling it flatten(), it would be called walk and provide a generalized capability to descend

Re: [Python-Dev] (no subject)

2005-03-16 Thread Nick Coghlan
Phillip J. Eby wrote: At 10:36 PM 3/15/05 +1000, Nick Coghlan wrote: Does deciding whether or not to supply the function really need to be dependent on whether or not a format for __signature__ has been chosen? Um, no. Why would you think that? Pronoun confusion. I interpreted an 'it' in your

Re: [Python-Dev] code blocks using 'for' loops and generators

2005-03-16 Thread Samuele Pedroni
Josiah Carlson wrote: Greg Ewing [EMAIL PROTECTED] wrote: Josiah Carlson wrote: Since PEP 310 was already mentioned, can we just say that the discussion can be boiled down to different ways of spelling __enter__/__exit__ from PEP 310? It's not quite the same thing. PEP 310 suggests a mechanism

Re: [Python-Dev] itertools.walk()

2005-03-16 Thread Bob Ippolito
On Mar 16, 2005, at 6:19, Raymond Hettinger wrote: Some folks on comp.lang.python have been pushing for itertools to include a flatten() operation. Unless you guys have some thoughts on the subject, I'm inclined to accept the request. Rather than calling it flatten(), it would be called walk and

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Nick Coghlan
Guido van Rossum wrote: 2. How would the initial value that forms the basis of summation be built for non-empty sequences? Here's you're way off. There's never any use of +=, so never any need to create a new object. The algorithm I had in mind was: - if empty, return 2nd arg - if one item,

Re: [Python-Dev] itertools.walk()

2005-03-16 Thread Nick Coghlan
Bob Ippolito wrote: On Mar 16, 2005, at 6:19, Raymond Hettinger wrote: Some folks on comp.lang.python have been pushing for itertools to include a flatten() operation. Unless you guys have some thoughts on the subject, I'm inclined to accept the request. Rather than calling it flatten(), it would

[Python-Dev] BRANCH FREEZE for 2.4.1rc2 at 2005-03-18 0000 UTC

2005-03-16 Thread Anthony Baxter
The release24-maint branch should be considered FROZEN as at UTC on 2005-03-18 - in other words, in about 11 hours time. Allegedly this is around 1900 on the 17th for the US East Coast. I'll post again once it's unfrozen. From here, we'll be aiming at a 2.4.1 final for the 29th - straight

Re: [Python-Dev] BRANCH FREEZE for 2.4.1rc2 at 2005-03-**17** 0000 UTC

2005-03-16 Thread Anthony Baxter
On Thursday 17 March 2005 00:28, Anthony Baxter wrote: The release24-maint branch should be considered FROZEN as at UTC on 2005-03-18 That should of course be 2005-03-17. -- Anthony Baxter [EMAIL PROTECTED] It's never too late to have a happy childhood.

Re: [Python-Dev] itertools.walk()

2005-03-16 Thread Bob Ippolito
On Mar 16, 2005, at 8:37 AM, Nick Coghlan wrote: Bob Ippolito wrote: On Mar 16, 2005, at 6:19, Raymond Hettinger wrote: Some folks on comp.lang.python have been pushing for itertools to include a flatten() operation. Unless you guys have some thoughts on the subject, I'm inclined to accept the

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Michael Walter
On Tue, 15 Mar 2005 07:47:20 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: But I'm not so sure now. Thinking ahead to generic types, I'd like the full signature to be: def sum(seq: sequence[T], initial: T = 0) - T. Would this _syntax_ work with generic types: def sum(seq:

RE: [Python-Dev] Lambda deferred evaluation (was: Adding any() andall())

2005-03-16 Thread Andrew Koenig
Lambda will be more difficult. Eric Raymond adapted an anti-gun control slogan and said you can pry lambda out of my cold dead hands. A bunch of folks will sorely miss the ability to create anonymous functions on the fly. When lambda is used for deferred argument evaluation (a la PEP

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Guido van Rossum
Thinking ahead to generic types, I'd like the full signature to be: def sum(seq: sequence[T], initial: T = 0) - T. Would this _syntax_ work with generic types: def sum(seq: sequence[T], initial: T = T()) - T. Maybe, but it would preclude union types; continuing with the (bad)

Re: [Python-Dev] code blocks using 'for' loops and generators

2005-03-16 Thread Josiah Carlson
Samuele Pedroni [EMAIL PROTECTED] wrote: Josiah Carlson wrote: Greg Ewing [EMAIL PROTECTED] wrote: Josiah Carlson wrote: Since PEP 310 was already mentioned, can we just say that the discussion can be boiled down to different ways of spelling __enter__/__exit__ from PEP 310? It's

Re: [Python-Dev] rationale for the no-new-features approach

2005-03-16 Thread Gregory P. Smith
On Fri, Mar 11, 2005 at 06:47:11PM -0500, Bob Ippolito wrote: On Mar 11, 2005, at 2:26 PM, Skip Montanaro wrote: Bob try: Bob set Bob except NameError: Bob from sets import Set as set Bob You don't need the rest. Sure, but then pychecker bitches about

RE: [Python-Dev] rationale for the no-new-features approach

2005-03-16 Thread Tony Meyer
[Bob Ippolito] try: set except NameError: from sets import Set as set You don't need the rest. [Skip Montanaro] Sure, but then pychecker bitches about a statement that appears to have no effect. ;-) [Bob Ippolito] Well then fix PyChecker to look for this pattern :) +1.

Re: [Python-Dev] Problems with definition of _POSIX_C_SOURCE

2005-03-16 Thread Tim Peters
[Jack Jansen] On a platform I won't mention here I'm running into problems compiling Python, because of it defining _POSIX_C_SOURCE. ... Does anyone know what the real meaning of this define is? LOL. Here's the Official Story:

Re: [Python-Dev] rationale for the no-new-features approach

2005-03-16 Thread Gregory P. Smith
[Gregory P. Smith] or make it even uglier to hide from pychecker by writing that as: exec( try: set except NameError: from sets import Set as set ) I presume that was somewhat tongue-in-cheek, but if it wasn't, please reconsider. Modulefinder isn't able to realise

[Python-Dev] Problems with definition of _POSIX_C_SOURCE

2005-03-16 Thread Jack Jansen
On a platform I won't mention here I'm running into problems compiling Python, because of it defining _POSIX_C_SOURCE. It turns out that on this platform the definition causes all sorts of declarations in sys/types.h to be skipped (presumably because they're not official Posix identifiers),

[Python-Dev] thunks (was: code blocks using 'for' loops and generators)

2005-03-16 Thread Brian Sabbey
Jim Jewett wrote: It may be time to PEP (or re-PEP), if only to clarify what people are actually asking for. I will PEPify this, unless someone does not think I am the correct person to do so. The PEP is probably a better place to try to address questions you raise, as well as give the

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Greg Ewing
Tim Peters wrote: I can't say it bothers me to specify an appropriate identity element when 0 is inappropriate. Maybe instead of a single sum() function, each summable type should have a sum() static method which uses an identity appropriate to that type. So to sum a list of integers you would use

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Greg Ewing
John Williams wrote: Michael Walter wrote: Would this _syntax_ work with generic types: def sum(seq: sequence[T], initial: T = T()) - T. This doesn't make sense with existing semantics because default arguments are evaluated when the function is defined, but T() can't be evaluated until the

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Michael Walter
On Wed, 16 Mar 2005 08:28:22 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: Thinking ahead to generic types, I'd like the full signature to be: def sum(seq: sequence[T], initial: T = 0) - T. Would this _syntax_ work with generic types: def sum(seq: sequence[T], initial: T =

[Python-Dev] Rationale for sum()'s design?

2005-03-16 Thread Michael Walter
On Thu, 17 Mar 2005 14:34:23 +1300, Greg Ewing [EMAIL PROTECTED] wrote: Not to mention that if the seq is empty, there's no way of knowing what T to instantiate... You just use the same T as inferred for seq : sequence[T] wink. Michael ___ Python-Dev