summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-01-18 05:47:48 (GMT)
committerGitHub <noreply@github.com>2019-01-18 05:47:48 (GMT)
commit3bcbedc9f1471d957a30a90f9d1251516b422416 (patch)
tree8011052f704ebd4db1a1b77d04f9dc831bf35d2e /Doc/whatsnew
parente55cf024cae203f63b4f78f1b21c1375fe424441 (diff)
downloadcpython-3bcbedc9f1471d957a30a90f9d1251516b422416.zip
cpython-3bcbedc9f1471d957a30a90f9d1251516b422416.tar.gz
cpython-3bcbedc9f1471d957a30a90f9d1251516b422416.tar.bz2
bpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.8.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index bf8d8f1..0360be6 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -442,6 +442,13 @@ Changes in Python behavior
in the leftmost :keyword:`!for` clause).
(Contributed by Serhiy Storchaka in :issue:`10544`.)
+* The compiler now produces a :exc:`SyntaxWarning` when identity checks
+ (``is`` and ``is not``) are used with certain types of literals
+ (e.g. strings, ints). These can often work by accident in CPython,
+ but are not guaranteed by the language spec. The warning advises users
+ to use equality tests (``==`` and ``!=``) instead.
+ (Contributed by Serhiy Storchaka in :issue:`34850`.)
+
Changes in the Python API
-------------------------