generator expressions and new ternary operator

Z

zipher

It seems the debate over PEP 308 (if-then-else expression) occurred
prior to the arrival of generator expressions.

Mightn't this new latter syntax be the ticket to a "one obvious way"
to write a ternary expression in python?

zipher
 
S

Steven Bethard

zipher said:
Mightn't this new latter syntax be the ticket to a "one obvious way"
to write a ternary expression in python?

I really shouldn't respond to this because the debate over a ternary operator
already went on *way* too long... But this proposal completely confuses me...

Why would we want something that isn't a generator expression to look anything
like one?

Steve
 
G

Gerrit

zipher said:
It seems the debate over PEP 308 (if-then-else expression) occurred
prior to the arrival of generator expressions.

Mightn't this new latter syntax be the ticket to a "one obvious way"
to write a ternary expression in python?

No. This has been suggested, and been rejected. And since generator
expressions have nothing to do with ternary expressions, it is not a
reason to re-do the discussion. There are literally thousands of
messages in the archives, including sub-threads discussing exactly this
syntax. By the time you've (re-)read them all, we'll be way beyond
Python 3.0 ;-)

yours,
Gerrit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top