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@mail.de> wrote:


On 19.09.2015 01:18, Erik wrote:
Apologies for the self-reply. I just wanted to clarify a couple of
things.

On 18/09/15 23:56, Erik wrote:
If the foo operator uses the magic method "__foo__" to mean "return an
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?
bar.isoformat()

and the original syntax suggestion:

bar = foo?.isoformat()

Which is clearly wrong - the first part should be:

baz = foo?
bar = baz.isoformat()

E.

(*) Should we call the operator "shrug"?

Maybe monad?


Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

--
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.