colloquial names for types?
Andrew Koenig
ark at research.att.com
Sun Aug 25 13:40:35 EDT 2002
Chris> Andrew Koenig <ark at research.att.com> wrote in
Chris> news:yu99bs7q50yp.fsf at europa.research.att.com:
>> For example, the colloquial type of 3
>> is "int", not "<type 'int'>", and the colloquial type of a class is
>> the name of the class, not including the module in which the class is
>> defined.
Chris> does that help:
>>>> type(3).__name__
Chris> types are classes and the __name__ attribute gives the class name.
Thanks. I suspected there had to be something like that, but
it takes a two-level-deep search in the documentation to find it.
--
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark
More information about the Python-list
mailing list