[Python-ideas] A better (simpler) approach to PEP 505

Mark E. Haase mehaase at gmail.com
Mon Jul 23 14:43:03 EDT 2018


On Mon, Jul 23, 2018 at 2:12 PM Rhodri James <rhodri at kynesim.co.uk> wrote:

>
> How are you supposed to do method calling, the equivalent of
> "foo?.bar()" ?  "NoneAware(foo).bar.unbox()()" looks downright weird.
> Is there more magic in NoneAware to cover this case?  (Not that I think
> we should be encouraging people to do this, but...)
>
>
In PyMaybe, you would do this:

maybe(foo).bar().or_else(None)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180723/099978c0/attachment.html>


More information about the Python-ideas mailing list