[Tutor] defined()

Alan Gauld ukc802591034 at btconnect.com
Mon Apr 3 19:07:26 CEST 2006


> I can't find the defined() function in python, so I used
>'variable name' in dir()

> Is it really missing, or I am just so simple ?

It is really missing, just as it is for most programming languages.
Which language(s) do you know that has such a feature?
And why do you consider it so useful that you expect to find
it in Python?

The main place where I could see such a thing being useful
would be in dynamically loaded code but then the usual
approach is to load a dictionary and an 'in' check suffices.

I'm interested in what use you would make of such a thing?

-- 
Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld






More information about the Tutor mailing list