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

Guido van Rossum guido at python.org
Tue Aug 2 00:57:12 EDT 2016


The parentheses really strike me as too much complexity. You should
just split it up into multiple lines, or use a semicolon.

On Mon, Aug 1, 2016 at 7:57 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> 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
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-ideas mailing list