[Tutor] should this cause a syntax error?

lumbricus@gmx.net lumbricus@gmx.net
Sat Nov 2 12:30:04 2002


Hi!
 
> Hi, I spent bout an hour scratching my head tryng to find why a class
> was misbehaving, then I found a typo.
> 
> self.some_value == FALSE
> 
> rather than the correct
> 
> self.some_value = FALSE
> 
> Shouldn't the first one have caused a syntax error as it was not in an
> if or while loop etc?

Why should it? It is a correct expression (yet redundant)
If you throw away its value it is your problem.
Sometimes you do this intentionally, because you
just need the side effect of a statement.
 
HTH, J"o!

-- 
Wir beschliessen etwas, stellen das dann in
den Raum und warten dann einige Zeit ab, was
passiert. Wenn es dann kein grosses Geschrei
gibt und keine Aufstaende, weil die meisten
gar nicht begreifen, was da beschlossen
wurde, dann machen wir weiter - Schritt fuer
Schritt, bis es kein Zurueck mehr gibt. 
   -- J-C Juncker

+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!