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