[Python-ideas] PEP 484 (Type Hints) -- second draft

Greg greg.ewing at canterbury.ac.nz
Tue Mar 24 03:58:46 CET 2015


On 24/03/2015 11:08 a.m., Antoine Pitrou wrote:

> I agree with cast(x, T). It also nicely mirrors isinstance(x, T).

I think that cast(T, x) is more readable when x is a long expression.
It puts the type next to the thing using or being assigned the result,
making it easier to visually verify that the types match up.

-- 
Greg



More information about the Python-ideas mailing list