Re: Check For SELF Variable Existance

2008-03-11 Thread Terry Reedy
"Robert Rawlins" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 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 y

RE: Check For SELF Variable Existance

2008-03-11 Thread Robert Rawlins
Thank you Simon, I was hoping there would be something as simple as that :-) Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon Brunning Sent: 11 March 2008 13:21 To: python-list@python.org Subject: Re: Check For SELF Variable Existance On Tue

Re: Check For SELF Variable Existance

2008-03-11 Thread Simon Brunning
On Tue, Mar 11, 2008 at 11:00 AM, Robert Rawlins <[EMAIL PROTECTED]> wrote: > I want to be able to check if a class has a certain property in its 'self' > scope, what's the best way to do this? >>> class Spam(object): ... def egg(self): ... if hasattr(self, 'chips'): print 'got chips!