is this a bug?

Alex Martelli aleaxit at yahoo.com
Thu Aug 16 17:40:48 EDT 2001


"Vassilis Virvilis" <vasvir at iit.demokritos.gr> wrote in message
news:3B7C38BF.8BD22DC5 at iit.demokritos.gr...
    ...
> So is it safe to do?
> if type(a) is type(b): blah blah

It will work just the same as

    if type(a) == type(b): blah blah

(Both are generally a terrible idea, but in the extremely rare case
where you do need type-identity they're equivalent).


Alex






More information about the Python-list mailing list