None assigment

Mark Pilgrim f8dy at
Thu Feb 8 13:16:59 EST 2001

In article <95ugd4$jka$1 at>,
  aahz at (Aahz Maruch) wrote:
> In article <mailman.981633367.1329.python-list at>,
> Gregoire Welraeds  <greg at> wrote:
> >
> >While playing a bit with python 2.0, I found that I can assign some
> >to None
> >
> >EG: None= 2
> >
> >which I found to be very pernicious because then the following, for
> >example, won't work any more:
> >
> >>>> b= filter(None, [1,2,'',3])
> >
> >Bug or feature ?
> Neither, really; it's Just The Way Things Work.

Indeed.  I once had a similar experience; while playing around in the
Python IDE, I defined a variable 'dir' to hold some directory path.
Then days later (having never shut down Python), I wondered why the
built-in 'dir' function didn't work.

Which leads to the following questions:
- Are there any true constants in Python?  (I don't think so, but
correct me if I'm wrong.)
- Once you've redefined a built-in function like 'dir', is there any
way to get it back without restarting Python?

You're smart; why haven't you learned Python yet?

Sent via

More information about the Python-list mailing list