strict python?

Michael Abbott michael at rcp.co.uk
Fri Dec 7 06:51:30 EST 2001


Erik Max Francis <max at alcyone.com> wrote in 
news:3C107172.6866DC18 at alcyone.com:

> Hans Nowak wrote:
> 
>> Well, 'self.func' is a perfectly valid Python expression, just like
>> '3'. Not very useful when used like this, but still, perfectly valid. 
> 
> Seems like now there are warning facilities built into the language it
> might be useful to have warnings emitted in situations like this (a
> statement with no side effects) -- things that are truly not error but
> are genuinely not useful either.
> 

Unfortunately, it is possible that self.func does indeed have important 
side effects, and in general the Python compiler can't tell.  For example, 
there might be a __getattr__ method defined doing something naughty behind 
the scenes!



More information about the Python-list mailing list