[Python-bugs-list] [ python-Bugs-540874 ] BoolType should be added to types.py
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 08 Apr 2002 00:22:28 -0700
Bugs item #540874, was opened at 2002-04-07 23:12
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=540874&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brian Quinlan (bquinlan)
Assigned to: Guido van Rossum (gvanrossum)
Summary: BoolType should be added to types.py
Initial Comment:
That's it :-)
----------------------------------------------------------------------
>Comment By: Brian Quinlan (bquinlan)
Date: 2002-04-08 00:22
Message:
Logged In: YES
user_id=108973
I understand your point about isinstance being the one true
way of doing things now.
But I don't understand what your code is trying to
demonstrate.
As long as this works:
>>> type(True) is type(bool(1))
True
>>> type(1) is type(bool(1))
False
I don't see why StringType should be in types.py and
BoolType shouldn't be.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2002-04-07 23:23
Message:
Logged In: YES
user_id=31435
Probably not, Brian. types.py largely exists just for
backward compatibility now. If you want the bool type,
just say "bool"!
>>> bool
<type 'bool'>
>>> type(bool)
<type 'type'>
>>> isinstance(True, bool)
True
>>>
Like also int, str, long, file, dict, ... in 2.2, what used
to be builtin functions for constructing an object of a
given type are now *the* type objects themselves, acting as
constructors for objects of their types. There's no reason
to add them to types.py too.
Assigning to Guido in case he disagrees.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=540874&group_id=5470