[issue34850] Emit a syntax warning for "is" with a literal

Anthony Sottile report at bugs.python.org
Sat Apr 13 16:22:42 EDT 2019


Anthony Sottile <asottile at umich.edu> added the comment:

Should this also produce warnings for `list` / `dict` / `set` literals?

```
$ python3.8
Python 3.8.0a3 (default, Mar 27 2019, 03:46:44) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x is []
False
>>> x is {}
False
>>> x is {1, 2}
False
```

----------
nosy: +Anthony Sottile

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34850>
_______________________________________


More information about the Python-bugs-list mailing list