Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Georg Brandl
Am 04.05.2013 01:22, schrieb Antoine Pitrou: On Sat, 04 May 2013 11:15:17 +1200 Greg Ewing greg.ew...@canterbury.ac.nz wrote: Eli Bendersky wrote: I'm just curious what it is about enums that sets everyone on a let's make things safer path. Python is about duck typing, it's absolutely

Re: [Python-Dev] PEP 4XX: pyzaa Improving Python ZIP Application Support

2013-05-04 Thread Steven D'Aprano
On 04/05/13 15:13, Stephen J. Turnbull wrote: Steven D'Aprano writes: Rather than risk obscure bugs, I would suggest restricting the extensions to 3 characters. For the “Windowed Python ZIP Applications” case, could we use .pzw as the extension instead of .pyzw? +0 Many

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Nick Coghlan
On Sat, May 4, 2013 at 4:10 PM, Georg Brandl g.bra...@gmx.net wrote: Am 04.05.2013 01:22, schrieb Antoine Pitrou: On Sat, 04 May 2013 11:15:17 +1200 Greg Ewing greg.ew...@canterbury.ac.nz wrote: Eli Bendersky wrote: I'm just curious what it is about enums that sets everyone on a let's make

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Greg Ewing
Guido van Rossum wrote: Code that wants to validate a string the user typed as input. Web forms just don't work that way. Maybe validation was a misleading term to use. To be more precise, I'm talking about taking input to the program (it needn't come directly from a user, it could be read

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Greg Ewing
Nick Coghlan wrote: 1. The current PEP, offering only getattr(MyEnum, name). 2. We restore __getitem__ on EnumMetaclass *solely* for member lookup by name 3. Use keyword arguments to distinguish two different ways of calling the enum class: MyEnum(value = 1) -- lookup by value

Re: [Python-Dev] PEP 4XX: pyzaa Improving Python ZIP Application Support

2013-05-04 Thread Nick Coghlan
On Sat, May 4, 2013 at 4:15 PM, Steven D'Aprano st...@pearwood.info wrote: On 04/05/13 15:13, Stephen J. Turnbull wrote: Steven D'Aprano writes: Rather than risk obscure bugs, I would suggest restricting the extensions to 3 characters. For the “Windowed Python ZIP Applications”

Re: [Python-Dev] PEP 4XX: pyzaa Improving Python ZIP Application Support

2013-05-04 Thread Stephen J. Turnbull
Steven D'Aprano writes: Give us a non-MS example, please. I'm afraid I don't understand your question. There were two problems mentioned. Paul worries about 4-letter extensions under PowerShell. You mentioned conflicts in Linux file managers. In both cases, a bug on Windows in detecting

Re: [Python-Dev] PEP 4XX: pyzaa Improving Python ZIP Application Support

2013-05-04 Thread Paul Moore
On 4 May 2013 07:48, Nick Coghlan ncogh...@gmail.com wrote: We don't need examples of arbitrary data file extentions, we need examples of 4 letter extensions that are known to work correctly when placed on PATHEXT, including when called from PowerShell. In the absence of confirmation that

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Phil Connell
On 4 May 2013 07:42, Nick Coghlan ncogh...@gmail.com wrote: 2. We restore __getitem__ on EnumMetaclass *solely* for member lookup by name (the getmember functionality above). This would leave __call__ used for the reverse lookup (value to member and hence name) and __getitem__ for the forward

Re: [Python-Dev] Difference in RE between 3.2 and 3.3 (or Aaron Swartz memorial)

2013-05-04 Thread Armin Rigo
Hi Matej, On Thu, Mar 7, 2013 at 11:08 AM, Matej Cepl mc...@redhat.com wrote: if c is not ' ' and c is not ' ': if c != ' ' and c != ' ': Sorry for the delay in answering, but I just noticed what is wrong in this fix: it compares c with the same single-character ' '

Re: [Python-Dev] PEP 4XX: pyzaa Improving Python ZIP Application Support

2013-05-04 Thread Antoine Pitrou
On Sat, 04 May 2013 11:41:27 +1000 Steven D'Aprano st...@pearwood.info wrote: Rather than risk obscure bugs, I would suggest restricting the extensions to 3 characters. For the “Windowed Python ZIP Applications” case, could we use .pzw as the extension instead of .pyzw? I've had Linux

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Antoine Pitrou
On Sat, 4 May 2013 16:42:08 +1000 Nick Coghlan ncogh...@gmail.com wrote: On Sat, May 4, 2013 at 4:10 PM, Georg Brandl g.bra...@gmx.net wrote: Am 04.05.2013 01:22, schrieb Antoine Pitrou: On Sat, 04 May 2013 11:15:17 +1200 Greg Ewing greg.ew...@canterbury.ac.nz wrote: Eli Bendersky wrote:

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Ethan Furman
On 05/04/2013 04:33 AM, Antoine Pitrou wrote: On Sat, 4 May 2013 16:42:08 +1000 Nick Coghlan ncogh...@gmail.com wrote: On Sat, May 4, 2013 at 4:10 PM, Georg Brandl g.bra...@gmx.net wrote: Am 04.05.2013 01:22, schrieb Antoine Pitrou: On Sat, 04 May 2013 11:15:17 +1200 Greg Ewing

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Eric V. Smith
On 5/4/2013 2:42 AM, Nick Coghlan wrote: On Sat, May 4, 2013 at 4:10 PM, Georg Brandl g.bra...@gmx.net wrote: Am 04.05.2013 01:22, schrieb Antoine Pitrou: On Sat, 04 May 2013 11:15:17 +1200 Greg Ewing greg.ew...@canterbury.ac.nz wrote: Eli Bendersky wrote: I'm just curious what it is about

Re: [Python-Dev] PEP 379 Python launcher for Windows - behaviour for #!/usr/bin/env python line is wrong

2013-05-04 Thread Vinay Sajip
Paul Moore p.f.moore at gmail.com writes: This will mean that scripts written with #!/usr/bin/env python will behave the same on Unix and Windows in the presence of activated virtualenvs. Overall I think it's the right result. There's one other compatibility clarification: at the moment, as

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Antoine Pitrou
On Sat, 04 May 2013 06:37:23 -0700 Ethan Furman et...@stoneleaf.us wrote: +1. An enum is basically a bidirectional mapping between some raw values and some nice instances, so it deserves a well-defined lookup operation in each direction. As I see it, there are 3 possible ways forward

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Guido van Rossum
Just to stop the bikeshedding, let's do #2. Put back __getitem__ solely for lookup by name. Keep __call__ (really __new__) for lookup by value or pass-through for members. --Guido On Fri, May 3, 2013 at 11:42 PM, Nick Coghlan ncogh...@gmail.com wrote: On Sat, May 4, 2013 at 4:10 PM, Georg

Re: [Python-Dev] PEP 379 Python launcher for Windows - behaviour for #!/usr/bin/env python line is wrong

2013-05-04 Thread Paul Moore
On 4 May 2013 15:20, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Paul Moore p.f.moore at gmail.com writes: This will mean that scripts written with #!/usr/bin/env python will behave the same on Unix and Windows in the presence of activated virtualenvs. Overall I think it's the right

Re: [Python-Dev] PEP 379 Python launcher for Windows - behaviour for #!/usr/bin/env python line is wrong

2013-05-04 Thread Vinay Sajip
Paul Moore p.f.moore at gmail.com writes: divPS Vinay - from this post, I assume you're already looking at this code? I was considering trying to put together a patch, but I don't want to duplicate effort if you're working on it./div I've taken a quick look at it, but I probably won't be able

Re: [Python-Dev] [Python-checkins] cpython: #17115, 17116: Have modules initialize the __package__ and __loader__

2013-05-04 Thread Brett Cannon
FYI, I'm aware this broke some buildbots and will have a look today to figure out why. On Sat, May 4, 2013 at 1:57 PM, brett.cannon python-check...@python.org wrote: http://hg.python.org/cpython/rev/e39a8f8ceb9f changeset: 83607:e39a8f8ceb9f user:Brett Cannon br...@python.org date:

[Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Eli Bendersky
Hello pydev, PEP 435 is ready for final review. A lot of the feedback from the last few weeks of discussions has been incorporated. Naturally, not everything could go in because some minor (mostly preference-based) issues did not reach a consensus. We do feel, however, that the end result is

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Victor Stinner
Great job guys. Victor Le 5 mai 2013 00:06, Eli Bendersky eli...@gmail.com a écrit : Hello pydev, PEP 435 is ready for final review. A lot of the feedback from the last few weeks of discussions has been incorporated. Naturally, not everything could go in because some minor (mostly

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Larry Hastings
On 05/04/2013 07:01 AM, Eric V. Smith wrote: On 5/4/2013 2:42 AM, Nick Coghlan wrote: I'm now -1 on my own as_dict() suggestion, due to the general name clash problem for arbitrary enums. To avoid the name collision, namedtuple calls this _asdict(). Although I recall Raymond told me he

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Tim Delaney
Typo line 171: Colro.blue: 3 One thing I'd like to be clear in the PEP about is whether enum_type and _EnumDict._enum_names should be documented, or whether they're considered implementation details. I'd like to make a subclass of Enum that accepts ... for auto-valued enums but that requires

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Guido van Rossum
Hm. Trailing underscores look *really* weird to me. On Sat, May 4, 2013 at 3:41 PM, Larry Hastings la...@hastings.org wrote: On 05/04/2013 07:01 AM, Eric V. Smith wrote: On 5/4/2013 2:42 AM, Nick Coghlan wrote: I'm now -1 on my own as_dict() suggestion, due to the general name clash problem

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Eli Bendersky
On Sat, May 4, 2013 at 4:27 PM, Tim Delaney timothy.c.dela...@gmail.comwrote: Typo line 171: Colro.blue: 3 Fixed, thanks. One thing I'd like to be clear in the PEP about is whether enum_type and _EnumDict._enum_names should be documented, or whether they're considered implementation

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Tim Delaney
On 5 May 2013 10:49, Eli Bendersky eli...@gmail.com wrote: On Sat, May 4, 2013 at 4:27 PM, Tim Delaney timothy.c.dela...@gmail.comwrote: Typo line 171: Colro.blue: 3 Fixed, thanks. One thing I'd like to be clear in the PEP about is whether enum_type and _EnumDict._enum_names should

[Python-Dev] CLA link from bugs.python.org

2013-05-04 Thread Tim Delaney
It appears there's no obvious link from bugs.python.org to the contributor agreement - you need to go via the unintuitive link Foundation - Contribution Forms (and from what I've read, you're prompted when you add a patch to the tracker). I'd suggest that if the Contributor Form Received field is

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Tim Delaney
On 5 May 2013 11:22, Tim Delaney timothy.c.dela...@gmail.com wrote: On 5 May 2013 10:49, Eli Bendersky eli...@gmail.com wrote: On Sat, May 4, 2013 at 4:27 PM, Tim Delaney timothy.c.dela...@gmail.comwrote: Typo line 171: Colro.blue: 3 Fixed, thanks. One thing I'd like to be clear in

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Tim Delaney
On 5 May 2013 13:11, Tim Delaney timothy.c.dela...@gmail.com wrote: @@ -142,6 +152,7 @@ if obj_type in (object, Enum): enum_item = object.__new__(enum_class) else: +value = obj_type.__new__(obj_type, value)

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Ethan Furman
On 05/04/2013 08:11 PM, Tim Delaney wrote: I've been able to achieve the auto-numbering without relying on the internal implementation at all (with a limitation), with a single change to enum_type.__new__. My previous patch was slightly wrong - fix below as well. All existing tests pass.

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Tim Delaney
On 5 May 2013 13:32, Ethan Furman et...@stoneleaf.us wrote: On 05/04/2013 08:11 PM, Tim Delaney wrote: I've been able to achieve the auto-numbering without relying on the internal implementation at all (with a limitation), with a single change to enum_type.__new__. My previous patch was

Re: [Python-Dev] PEP 435 - requesting pronouncement

2013-05-04 Thread Eli Bendersky
On Sat, May 4, 2013 at 8:22 PM, Tim Delaney timothy.c.dela...@gmail.comwrote: On 5 May 2013 13:11, Tim Delaney timothy.c.dela...@gmail.com wrote: @@ -142,6 +152,7 @@ if obj_type in (object, Enum): enum_item = object.__new__(enum_class)

[Python-Dev] PEP 435 - reference implementation discussion

2013-05-04 Thread Tim Delaney
Split off from the PEP 435 - requesting pronouncement thread. Think I've come up with a system that works for my auto-numbering case without knowing the internals of enum_type. Patch passes all existing test cases. The patch does two things: 1. Finds the first non-Enum class on the MRO of the

Re: [Python-Dev] CLA link from bugs.python.org

2013-05-04 Thread Ezio Melotti
Hi, On Sun, May 5, 2013 at 4:23 AM, Tim Delaney timothy.c.dela...@gmail.com wrote: It appears there's no obvious link from bugs.python.org to the contributor agreement - you need to go via the unintuitive link Foundation - Contribution Forms (and from what I've read, you're prompted when you