forcing variable declaration ??

Alan Kennedy alanmk at hotmail.com
Tue May 27 09:22:46 EDT 2003


Axel Kowald wrote:

> Is there a trick/feature/module that allows me to force variable
> declaration in python?

If by "variable declaration" you mean restricting the names of variables
allowed to a declared set of names, then you can do that using the
__slots__ attribute on new-style classes. More info here in this
previous UseNet thread:-

http://tinyurl.com/cr8k

If you mean declaring the type of a variable, however, that's another
matter entirely.

HTH,

-- 
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/mailto/alan




More information about the Python-list mailing list