[Python-ideas] Syntax: 'return: ...' expressions

Chris Angelico rosuav at gmail.com
Mon Jan 5 11:46:46 CET 2015


On Mon, Jan 5, 2015 at 9:37 PM, Andrew Barnert <abarnert at yahoo.com> wrote:
> Are you suggesting that "return:" would be a single token (as opposed to all the other colons in the tokenizer), or that you'd use look ahead to disambiguate?

Oh, I see what you mean.

I'm sure this can be dealt with, though; if nothing else, requiring
that this kind of expression be parenthesized would do it, as 'return'
inside parens has no meaning. It'd be like a genexp.

But I still don't think it's a good idea :)

ChrisA


More information about the Python-ideas mailing list