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/2016-September/146174.html below:

[Python-Dev] Please reject or postpone PEP 526

[Python-Dev] Please reject or postpone PEP 526 [Python-Dev] Please reject or postpone PEP 526Koos Zevenhoven k7hoven at gmail.com
Sun Sep 4 12:58:50 EDT 2016
On Sun, Sep 4, 2016 at 7:43 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 4 September 2016 at 21:32, Ivan Levkivskyi <levkivskyi at gmail.com> wrote:
>> The first form still could be interpreted by type checkers
>> as annotation for value (a cast to more precise type):
>>
>> variable = cast(annotation, value) # visually also looks similar
>
> I think a function based spelling needs to be discussed further, as it
> seems to me that at least some of the goals of the PEP could be met
> with a suitable definition of "cast" and "declare", with no syntactic
> changes to Python. Specifically, consider:
>
>     def cast(value, annotation):
>         return value
>

typing.cast already exists.

-- Koos
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