-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BoolType should be added to types.py #36394
Comments
That's it :-) |
Logged In: YES Probably not, Brian. types.py largely exists just for >>> bool
<type 'bool'>
>>> type(bool)
<type 'type'>
>>> isinstance(True, bool)
True
>>> Like also int, str, long, file, dict, ... in 2.2, what used Assigning to Guido in case he disagrees. |
Logged In: YES I understand your point about isinstance being the one true But I don't understand what your code is trying to 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 |
Logged In: YES You would never write type(True) is type(bool(1)) Instead, you write type(True) is bool just the same way as you write type("") is str So in practice, there is no need to use the types module, So I agree with Tim that this is not a bug. |
Logged In: YES StringType should be in types for backwards compatibility. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: