[Python-ideas] + operator on generators

Steven D'Aprano steve at pearwood.info
Tue Jun 27 06:22:19 EDT 2017


On Tue, Jun 27, 2017 at 08:40:23PM +1200, Greg Ewing wrote:
> David Mertz wrote:
> >I just wish I could think of a good 
> >character that doesn't have some very different meaning in other 
> >well-known contexts (even among iterables).
> 
>    (a;b)
> 
> Should be unambiguous as long as the parens are required.

Except to the human reader, who can be forgiven for thinking "What the 
fudge is that semicolon doing there???" (or even less polite).

I don't know of any language that uses semi-colon as an operator.

That looks like a bug magnet to me. Consider what happens when (not if) 
you write (a,b) instead, or when you write

items = (x; y)

and it happens to succeed because x and y are iterable.

To be perfectly honest, and no offence is intended, this suggestion 
seems so wacky to me that I'm not sure if you intended for it to be 
taken seriously or not.



-- 
Steve


More information about the Python-ideas mailing list