Perl is worse! (was: Python is Wierd!)

Tim Peters tim_one at email.msn.com
Fri Jul 28 02:04:37 EDT 2000


[Steve Lamb]
> ...
> I just don't understand how people can advocate for types and the
> restrictions they impose while, on the other hand, embracing a
> language that is free enough to shoot yourself in the foot by
> reassigning None.

Frankly, I have trouble understanding that too.  Yet here we are, year after
year!

[Chris Lawrence ]
> Hmm, works in JPython too.  And Python 2.0b1.  Maybe it's a feature ;-)
>
> Frankly, I don't know how you'd get None back.

If you really must,

    import __builtin__
    None = __builtin__.None

Same as for any other builtin you go out of your way to destroy.  In the
case of None, though, simpler tricks will suffice, like

    None = [].sort()

> And it will play havoc with things:
>
> None = 1
> if None:
>   print 'Hello'
>
> I suspect Guido will tell you, "don't do that." ;-)

Nope!  In the very early days, Guido would *sometimes* warn people that, for
example, lawn mowers have very sharp blades, so you shouldn't pick one up by
the base and try to trim hedges with one.  He stopped doing that a long time
ago.  Now it's my job:  don't do that.

if-i-were-larry-you'd-think-that-was-cute<wink>-ly y'rs  - tim






More information about the Python-list mailing list