A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-May/147916.html below:

[Python-Dev] PEP 484 proposal: don't default to Optional if argument default is None

[Python-Dev] PEP 484 proposal: don't default to Optional if argument default is None [Python-Dev] PEP 484 proposal: don't default to Optional if argument default is NoneNick Coghlan ncoghlan at gmail.com
Tue May 9 22:37:42 EDT 2017
On 10 May 2017 at 08:51, Brett Cannon <brett at python.org> wrote:
> On Tue, 9 May 2017 at 11:11 Carl Meyer <carl at oddbird.net> wrote:
>> It might be nice to have a less verbose syntax for Optional, but that
>> can be a separate discussion.
>
> You should be able to do that today with `from typing import Optional as Eh`
> or whatever your preferred optional/maybe name is. :)

While "from typing import Optional as Opt" can indeed help, perhaps
PEP 505 should be updated to discuss this point in addition to the
current proposals for None-aware binary operators?

If it included a ? prefix operator as a shorthand for
"typing.Optional[<expr>]", that would shorten affected declarations
back to:

    def handle_employee(e: ?Employee = None) -> None: ...

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4