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

Neil Hodgson nhodgson at bigpond.net.au
Wed Feb 11 16:28:18 EST 2004


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
any
> effect?

   I have seen this used as a test. Simplified:

try:
    f.close
except AttributeError:
    f.close = makeAMethod()

   Neil





More information about the Python-list mailing list