18 Jan
2015
18 Jan
'15
12:17 p.m.
On Sat, Jan 17, 2015 at 8:14 AM, Dennis Brakhane <brakhane@googlemail.com> wrote:
The PEP does not mention MyPy style casts. Is this intentional?
No, we ran out of time for the first draft (and Łukasz needed some pushing to like them :-). The conclusion in https://github.com/ambv/typehinting/issues/15 is that we will add it.
If yes, are casts not supported at all, or is there just no cast in typing and people should use type: comments instead?
x = [1,2,3] # type: Iterable[int] y = x # type: Sequence[int]
The issue I linked to also explains the difference (it's subtle!). If someone wants to give describing cast() in the PEP a shot, send a PR! -- --Guido van Rossum (python.org/~guido)