[Python-ideas] One more time... lambda function <--- from *** signature def.

MRAB python at mrabarnett.plus.com
Tue Mar 4 14:30:32 CET 2014


On 2014-03-04 09:03, David Townshend wrote:
>
>
>
> On Tue, Mar 4, 2014 at 9:03 AM, Andrew Barnert <abarnert at yahoo.com
> <mailto:abarnert at yahoo.com>> wrote:
>
>     On Mar 3, 2014, at 22:02, David Townshend <aquavitae69 at gmail.com
>     <mailto:aquavitae69 at gmail.com>> wrote:
>>
>>     What about a new code literal object, e.g.
>>
>>         thunk = c'x + 3'
>>         thunk(x=2)
>>
>     Why does it need to be built from/look like a string? I think it
>     would be just as simple for the parser, and simpler for editors, and
>     less misleading for readers, if it used a different marker.
>
>     Not that I'm seriously suggesting backticks here, but...
>
>          thunk = `x + 3`
>
>
> The only real reason for it looking like a string is a shortage of
> symbols.  Backticks are off limits, and most other symbols are just
> plain ugly (e.g. @x + 3@ or $x + 3$) or already in use in a way that
> could lead to ambiguity (e.g. |x + 3|).  String-like quotes seem like a
> better option than the alternatives.
>
[snip]

I'm sure that Unicode could provide some characters/codepoints.

For example:

thunk = 《x + 3》



More information about the Python-ideas mailing list