type names versus types module

Donnal Walter donnal at donnal.net
Fri Jul 26 16:39:26 EDT 2002


I read in Guido's keynote address (slide 15 of 23) that we are now
supposed to be using built-in type names instead of the types module.
What is the preferred alternative syntax in Python 2.2 for the
following snippet?

        ...
        if type(content) is types.ListType:
            print 'content is a list'
        else:
            print 'content is not a list'

Thanks,
Donnal



More information about the Python-list mailing list