How to avoid "f.close" (no parens) bug?

Michael Pyle mpyle at
Thu Feb 12 00:01:51 CET 2004

We used this to test whether the application was running in the development
environment or "frozen" into an executable. That knowledge in turn was used
to decide whether to create the "Debug" menu and allow certain command line
parameters. Very handy.

except AttributeError:
	options.append( 'debug-on' )


-----Original Message-----
From: Neil Hodgson [mailto:nhodgson at] 
Sent: Wednesday, February 11, 2004 1:28 PM
To: python-list at
Subject: Re: How to avoid "f.close" (no parens) bug?

Batista, Facundo:

> Why "appears"?
> There is any case when f.close, or bar or something like "not a call 
> to a function (there is no ')'), with no '=' at the left or at the 
> right" has
> effect?

   I have seen this used as a test. Simplified:

except AttributeError:
    f.close = makeAMethod()


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list