Check For SELF Variable Existance
Terry Reedy
tjreedy at udel.edu
Tue Mar 11 13:19:12 EDT 2008
"Robert Rawlins" <robert.rawlins at thinkbluemedia.co.uk> wrote in message
news:40727.816677145$1205243089 at news.gmane.org...
| Thank you Simon,
|
| I was hoping there would be something as simple as that :-)
| >>> class Spam(object):
| ... def egg(self):
| ... if hasattr(self, 'chips'): print 'got chips!'
I strongly suggest that you read Library Reference Ch.2 on builtin
functions and types.
More information about the Python-list
mailing list