bpo-15248: Emit a compiler warning when missed a comma before tuple or list. (GH-11757)

This commit is contained in:
Serhiy Storchaka 2019-02-16 08:12:19 +02:00 • committed by GitHub
parent a16ab00c0b
commit 62e4481238
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 239 additions and 6 deletions

View file

@ -115,6 +115,16 @@ Other Language Changes
a :exc:`SyntaxWarning` instead.
(Contributed by Serhiy Storchaka in :issue:`32912`.)
* The compiler now produces a :exc:`SyntaxWarning` in some cases when a comma
is missed before tuple or list. For example::
data = [
(1, 2, 3) # oops, missing comma!
(4, 5, 6)
]
(Contributed by Serhiy Storchaka in :issue:`15248`.)
* Arithmetic operations between subclasses of :class:`datetime.date` or
:class:`datetime.datetime` and :class:`datetime.timedelta` objects now return
an instance of the subclass, rather than the base class. This also affects