syntax difference

Rick Johnson rantingrickjohnson at gmail.com
Mon Jun 18 15:26:22 EDT 2018


On Monday, June 18, 2018 at 12:46:36 PM UTC-5, Chris Angelico wrote:

> What about assertions? Are they comments too? Should we
> have, for instance:
> 
> if x > 0:
>     ...
> elif x < 0:
>     ...
> else:
>     #assert: x == 0
>     ...
> 
> or is it better to use an 'assert' statement? After all,
> they can legitimately be ignored by the interpreter.

(oh my!)

Of course they can "easily be ignored", 

for cryin' out loud, 

assert statements all begin with the same "syntactical
tag"!

okay, wait for it... 

--> assert <--
    ^^^^^^

Yep!

Which BTW is a _keyword_. 

(if you didn't know that already) *wink*

But please Chris, feel free to bring us your next logical
dead end. 




More information about the Python-list mailing list