New submission from Raymond Hettinger <raymond.hettin...@gmail.com>:

Am not sure how much we care about this, but parenthesis around tuples stops 
being optional when there is a variable annotation. 

>>> from typing import Tuple
>>> t = 10, 'hello'                     # Parens not normally required
>>> t: Tuple[int, str] = (10, 'hello')  # Annotated allows parens
>>> t: Tuple[int, str] = 10, 'hello'    # Annotated w/o parens fails
SyntaxError: invalid syntax

----------
components: Interpreter Core
messages: 334280
nosy: rhettinger
priority: low
severity: normal
status: open
title: Syntax quirk with variable annotations
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35814>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to