[Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Barry Warsaw
In working on making Python 2.7 available in Debian and Ubuntu, we ran into two packages that fail to byte compile against Python 2.7, where they are fine in Python 2.6. The Debian bug tracker issues are: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590821 http://bugs.debian.org/cgi-b

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Guido van Rossum
On Fri, Jul 30, 2010 at 1:26 PM, Barry Warsaw wrote: > In working on making Python 2.7 available in Debian and Ubuntu, we ran into > two packages that fail to byte compile against Python 2.7, where they are fine > in Python 2.6.  The Debian bug tracker issues are: > >    http://bugs.debian.org/cgi

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Barry Warsaw
On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: >Well it is a reserved name so those packages that were setting it >should have known that they were using undefined behavior that could >change at any time. Shouldn't it be described here then? http://docs.python.org/reference/lexical_analys

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Michael Foord
On 30/07/2010 21:53, Barry Warsaw wrote: On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: Well it is a reserved name so those packages that were setting it should have known that they were using undefined behavior that could change at any time. Shouldn't it be described here the

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Guilherme Polo
2010/7/30 Barry Warsaw : > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: > >>Well it is a reserved name so those packages that were setting it >>should have known that they were using undefined behavior that could >>change at any time. > > Shouldn't it be described here then? > > http://doc

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Guido van Rossum
On Fri, Jul 30, 2010 at 1:53 PM, Barry Warsaw wrote: > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: > >>Well it is a reserved name so those packages that were setting it >>should have known that they were using undefined behavior that could >>change at any time. > > Shouldn't it be descri

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Steven D'Aprano
On Sat, 31 Jul 2010 07:44:42 am Guido van Rossum wrote: > On Fri, Jul 30, 2010 at 1:53 PM, Barry Warsaw wrote: > > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: > >>Well it is a reserved name so those packages that were setting it > >>should have known that they were using undefined behav

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-31 Thread Barry Warsaw
On Jul 31, 2010, at 08:32 AM, Steven D'Aprano wrote: >On Sat, 31 Jul 2010 07:44:42 am Guido van Rossum wrote: >> On Fri, Jul 30, 2010 at 1:53 PM, Barry Warsaw >wrote: >> > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: >> >>Well it is a reserved name so those packages that were setting it

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-31 Thread Greg Ewing
Barry Warsaw wrote: I've always understood the rules on double-underscore names to mean that Python reserves the use of those names for its own purposes, and is free to break your code if you define your own. That's very different than saying it's forbidden to use double-underscore names for your

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-08-01 Thread Benjamin Peterson
2010/7/30 Barry Warsaw : > > It looks like Benjamin's change in r67171 was the relevant diff. The reason behind this was to make __debug__ assignment consistent with that of other reserved names. For example, x.None = 3 raised and thus, so should x.__debug__ = 3. -- Regards, Benjamin _

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-08-02 Thread Barry Warsaw
On Aug 01, 2010, at 09:56 PM, Benjamin Peterson wrote: >2010/7/30 Barry Warsaw : >> >> It looks like Benjamin's change in r67171 was the relevant diff. > >The reason behind this was to make __debug__ assignment consistent >with that of other reserved names. For example, x.None = 3 raised and >thus