Tor Erik Soenvisen wrote:

> I've seen code like this:
>
> if type([]) is list:
>    print 'Is list'
>
> which seem to work. And also I've seen "var is None", as you mention.

None is guaranteed to be a singleton:

    http://effbot.org/pyref/type-none.htm

Why "is" works for type objects should be pretty obvious, of course.

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to