Assign to True / False in 2.3
Just
just at xs4all.nl
Wed Jul 2 06:38:02 EDT 2003
In article <3F02ADD3.6047F561 at alcyone.com>,
Erik Max Francis <max at alcyone.com> wrote:
> Culley Angus wrote:
>
> > I was a little suprised to find that I could assign a value to 'True',
> > and 'False' without warning though, and was wondering if this is
> > deliberate.
>
> This is true of pretty much all Python features. The only special
> dispensation goes to None, which is a warning now (in the 2.3 beta):
Actually, at some point there was a warning for True and False as well,
but it was taken out because there is plenty of code out there like this:
try:
True, False
except NameError:
True, False = 1, 0
(I'm not entirely sure, it can also be that there never was a warning in
place, but it was discussed.)
Just
More information about the Python-list
mailing list