-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-44712: Replace "type(literal)" with corresponding builtin types #27294
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
Conversation
Lib/test/test_zipimport.py
Outdated
mtime = int(mtime) | ||
else: | ||
mtime = int(-0x100000000 + int(mtime)) | ||
mtime = int(mtime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the next seem like different types of changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very old code, written when time could be int. It is complicated and not completely correct.
This change is included in #19708, so it will be removed from this PR.
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be put in the comfy chair! |
The type(x) replacements are a real improvement in readability. Consider removing other changes while adding a few ==/!= replacements with is/is not. |
This PR is stale because it has been open for 30 days with no activity. |
Lib/test/test_zipimport.py
Outdated
mtime = int(mtime) | ||
else: | ||
mtime = int(-0x100000000 + int(mtime)) | ||
mtime = int(mtime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very old code, written when time could be int. It is complicated and not completely correct.
This change is included in #19708, so it will be removed from this PR.
Co-authored-by: Terry Jan Reedy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to plistlib and build-installer.py look good to me.
Likewise for most other changes. This does change type checks from (effectively) type(value) is some_type
to instance(value, some_type)
and those are technically semantic changes. That said, the changes should have no visible behaviour change in practice.
I didn't look at the changes in tkinter, pydoc and xmlrpc, mostly due to lack of time: I didn't have to time to look deeply enough at the code to see if there are unexpected changes in behaviour.
https://bugs.python.org/issue44712
#88878