[Python-Dev] Other library updates

Guido van Rossum gvanrossum at gmail.com
Mon Feb 7 17:31:08 CET 2005


> Any objections to replacing the likes of types.IntType and
> types.ListType with int and list?

I presume in isinstance tests etc.? In general the procedure for
modernizing source code is not to touch it unless you're reviewing or
editing the whole module (or at least part of it) anyway.

This would be a good occasion to see if perhaps the tests you find are
formulated too narrowly -- e.g.  isinstance(x, int) should almost
always be isinstance(x, (int, long)), and isinstance(x, list) is also
often a poorly written test for "sequence-ness".

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list