list of all type names

Peter Maas peter at somewhere.com
Tue Mar 1 10:41:43 EST 2005


Klaus Neuner schrieb:
> Python has one feature that I really hate: There are certain special
> names like 'file' and 'dict' with a predefined meaning. Yet, it is
> allowed to redefine these special names as in

This is not a specific Python feature: If you include a header file
in C that redefines fopen(), wou will probably also run into problems.

> dict = [1:'bla']

I would avoid the use of generic names for variables but rather use
dict1 or aDict etc. If you want to avoid a name collision without
the use of naming conventions you could rename __builtins__:

bi = __builtins__
del __builtins__

Then you can define what you like but you will have to reference dict,
list etc. as bi.dict, bi.list, ...

For a fast check simply type e.g.

dict

in the interactive Interpreter. If you get a NameError it is not
built-in. :)

-- 
-------------------------------------------------------------------
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------



More information about the Python-list mailing list