New submission from Nico Schlömer <nico.schloe...@gmail.com>:

I stumbled upon this when dealing with NumPy arrays:
```
slice(None) is slice(None)
```
```
False
```
This came up when trying to check if a variable `a` equals `slice(None)`. The 
comparison
```
a = slice(None)
a == slice(None)
```
```
True
```
works, but doesn't return a single Boolean if a is a NumPy array, for example.

Perhaps there's another way of finding out if a variable is exactly 
`slice(None)`, but the failure of `is` seems like a bug.

----------
messages: 390598
nosy: nschloe
priority: normal
severity: normal
status: open
title: slice(None) is slice(None) is False

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

Reply via email to