[Python-ideas] Null coalescing operators
rymg19 at gmail.com
Sat Sep 19 01:47:31 CEST 2015
What about "apply"? It's the closest thing to "fmap" I can think of that won't coblnfuse people...
On September 18, 2015 6:44:31 PM CDT, "Sven R. Kunze" <srkunze at mail.de> wrote:
>On 19.09.2015 01:18, Erik wrote:
>> Apologies for the self-reply. I just wanted to clarify a couple of
>> On 18/09/15 23:56, Erik wrote:
>>> If the foo operator uses the magic method "__foo__" to mean "return
>>> object to be used in place of the operand should it be considered
>>> false? [or some other definition - I'm not sure]"
>> Not "false", I think. The "foo" operator is meant to mean "I will go
>> on to use the resulting object in any way imaginable and it must cope
>> with that and return a value from any attempts to use it that will
>> generally mean 'no'" (*).
>>> If that was a postfix operator which has a high precedence, then:
>>> bar = foo?
>>> and the original syntax suggestion:
>>> bar = foo?.isoformat()
>> Which is clearly wrong - the first part should be:
>> baz = foo?
>> bar = baz.isoformat()
>> (*) Should we call the operator "shrug"?
>Python-ideas mailing list
>Python-ideas at python.org
>Code of Conduct: http://python.org/psf/codeofconduct/
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas