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

Eric Brunel eric.brunel at N0SP4M.com
Wed Feb 11 11:41:39 EST 2004


Batista, Facundo wrote:
> Skip Montanaro wrote:
> 
> #- Pychecker reports:
> #- 
> #-     % pychecker foo.py
> #-     name: foo
> #-     Processing foo...
> #- 
> #-     Warnings...
> #- 
> #-     foo.py:4: Statement appears to have no effect
> 
> 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?

You may be able to call some "real" code just by accessing an attribute by using 
properties. I'm not quite sure, and I can't check because I have only Python 2.1 
here.

> If no, could Python alert before run time?
> 
> I don't see nothing, but I'm kinda blind, :p
> 
> .	Facundo
-- 
- Eric Brunel <eric dot brunel at pragmadev dot com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com




More information about the Python-list mailing list