On Sun, Sep 4, 2016 at 7:43 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 4 September 2016 at 21:32, Ivan Levkivskyi <levkivs...@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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com