python and macros (again) [Was: python3: 'where' keyword]

Antoon Pardon apardon at
Thu Jan 13 03:39:13 EST 2005

Op 2005-01-12, Steve Holden schreef <steve at>:
> Given that Guido is on record as saying that expressions aren't 
> statements because he wants those things to be separate, I don't really 
> see why there's this consistent pressure to reverse that decision.

Well, it seems that Guido is wrong then. The documentation clearly
states that an expression is a statement.

More specifically, everywhere you can use a statement, you can
simply use an expression according to the python syntax.

That makes the set of expressions a subset of the set of
statements and thus makes an expression a statement.

> Which would be a worthier goal than trying to graft macros on to Python. 
> You responded that macros would be difficult to implement in m4 because 
> (in essence) of the indented structure of Python. I'm not convinced 
> they'd be any easier in Python, and I'm *certainly* not convinced that 
> their addition would improve Python's readability.
> At best it would offer new paradigms for existing constructs (violating 
> the "there should be one obvious way to do it" zen); at worst it would 
> obfuscate the whole language.

That zen is already broken. Look at the number of answers one gets
if a newbee askes for a ternary operator. I think that a simple
ternary operator or macro's with an official supported macro that
implemented the ternary operator would have been far closer to
the spirit of only having one obvious way than what we have now.

Antoon Pardon

More information about the Python-list mailing list