[Python-ideas] Trial balloon: adding variable type declarations in support of PEP 484

Steven D'Aprano steve at pearwood.info
Mon Aug 1 22:57:12 EDT 2016


On Tue, Aug 02, 2016 at 07:40:39AM +1000, Chris Angelico wrote:

> Additional case, unless it's patently obvious to someone with more 484
> experience than I: what happens with chained assignment?
> 
> a = b = c = 0
> 
> Does each variable get separately tagged, or does one tag apply to all?

(a:int) = (b:Optional[int]) = c = 0

`a` is declared to always be an int, `b` declared to be an int or None, 
and `c` is not declared.



-- 
Steve


More information about the Python-ideas mailing list