logic behind the assert syntax?

Greg Landrum glandrum at my-deja.com
Mon Aug 28 20:11:35 EDT 2000


In article <blwvh1f11z.fsf at bitdiddle.concentric.net>,
  Jeremy Hylton <jeremy at beopen.com> wrote:
> Greg Landrum <glandrum at my-deja.com> writes:
>
> > Of course, I get completely confused again when I try and apply my
> > newfound "understanding" to other statements.
>
> Not too fast :-).  You should not apply understanding you've gained
> about one statement to others haphazardly.

oh man... that kind of sucks.  ;-)

> Perfectly straightforward :-).  You need to know enough of the
> language grammar to know which statements expect commas and which do
> not.

This is exactly what surprised me.  I've gotten lazy with Python,
where I normally leave all my C/C++ defense mechanism switched off.
The language is "right" so much of the time, that I get looped when
some little thing like comma-eating statements rears up and bites
me.

Curiously (and not particularly relevantly), I *expect* print to be
odd, so I never thought anything of its comma games.

By the way, thanks for the list of other "weird" statements.

I'll just keep repeating to myself: "Don't feed parens to statements
which eat commas!" and everything will be fine.

-greg


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list