[Python-bugs-list] [ python-Bugs-573663 ] Type slice comparisons
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 25 Jun 2002 08:10:21 -0700
Bugs item #573663, was opened at 2002-06-25 12:10
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=573663&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas J. Duck (tomduck)
Assigned to: Nobody/Anonymous (nobody)
Summary: Type slice comparisons
Initial Comment:
There seems to be a problem in identifing an object of
type 'slice'. For example, the type of an integer
can be found:
>>> type(1)
<type 'int'>
and comparisons are correctly made:
>>> type(1)==int
1
However, although the type of a slice can be found:
>>> type(slice(0,0,0))
<type 'slice'>
comparisons don't work properly:
>>> type(slice(0,0,0))==slice
0
Strangely, the following operation does work:
>>> type(slice(0,0,0))==type(slice(1,1,1))
1
So, the behaviour for type 'slice' is at least inconsistent
with other types such as 'int'.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=573663&group_id=5470