Skip to content
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

bpo-44712: Replace "type(literal)" with corresponding builtin types #27294

Merged
merged 7 commits into from
May 8, 2022

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jul 22, 2021

Lib/ftplib.py Outdated Show resolved Hide resolved
Lib/test/test_copyreg.py Show resolved Hide resolved
mtime = int(mtime)
else:
mtime = int(-0x100000000 + int(mtime))
mtime = int(mtime)
Copy link
Member

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.

Copy link
Member Author

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.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be put in the comfy chair!

@terryjreedy
Copy link
Member

The type(x) replacements are a real improvement in readability. Consider removing other changes while adding a few ==/!= replacements with is/is not.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Aug 24, 2021
Lib/test/test_copyreg.py Show resolved Hide resolved
Lib/test/test_copyreg.py Show resolved Hide resolved
Lib/test/test_pprint.py Show resolved Hide resolved
Lib/test/test_copyreg.py Show resolved Hide resolved
mtime = int(mtime)
else:
mtime = int(-0x100000000 + int(mtime))
mtime = int(mtime)
Copy link
Member Author

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.

@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review May 3, 2022 06:23
@serhiy-storchaka serhiy-storchaka requested review from a team and ethanfurman as code owners May 3, 2022 06:23
@serhiy-storchaka serhiy-storchaka removed the stale Stale PR or inactive for long period of time. label May 3, 2022
Copy link
Contributor

@ronaldoussoren ronaldoussoren left a 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.

Lib/cgitb.py Show resolved Hide resolved
Lib/test/test_copyreg.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants