René's URL Explorer Experiment


Title: Add NewType by Michael0x2a · Pull Request #1939 · python/mypy · GitHub

Open Graph Title: Add NewType by Michael0x2a · Pull Request #1939 · python/mypy

X Title: Add NewType by Michael0x2a · Pull Request #1939 · python/mypy

Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.

Open Graph Description: This pull request implements NewType as described in PEP 484 and in issue #1284. It also adds a variety of test cases to verify NewType works correctly when used and misused and adds information ab...

X Description: This pull request implements NewType as described in PEP 484 and in issue #1284. It also adds a variety of test cases to verify NewType works correctly when used and misused and adds information ab...

Opengraph URL: https://github.com/python/mypy/pull/1939

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:f978372f-38ca-98fd-804b-b38181cd9760
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id87C8:5537E:19938EA:21C689A:6B002152
html-safe-nonce39bd41078a41e754ba0ed8571784ba9dbe1d619fa81408fa9ac72f1740c56e25
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0M4OjU1MzdFOjE5OTM4RUE6MjFDNjg5QTo2QjAwMjE1MiIsInZpc2l0b3JfaWQiOiIxMjk5MzI3ODIzMzA3MDg4MjEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbdfac217903488597dffb23fae92d13c4c79166724ce997861b6b92263f755be
hovercard-subject-tagpull_request:78774344
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/mypy/1939/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/ff7ae1aa8ddb30338a5e7f64d6d025b459eff43d681b2431ec50a3dc8edb21de/python/mypy/pull/1939
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ff7ae1aa8ddb30338a5e7f64d6d025b459eff43d681b2431ec50a3dc8edb21de/python/mypy/pull/1939
og:image:altThis pull request implements NewType as described in PEP 484 and in issue #1284. It also adds a variety of test cases to verify NewType works correctly when used and misused and adds information ab...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMichael0x2a
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-cache
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/1939#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F1939
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F1939
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/pull/1939
Reloadhttps://github.com/python/mypy/pull/1939
Reloadhttps://github.com/python/mypy/pull/1939
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests546 (546)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
gvanrossumhttps://github.com/gvanrossum
python:masterhttps://github.com/python/mypy/tree/master
Michael0x2a:add-newtypehttps://github.com/Michael0x2a/mypy/tree/add-newtype
Conversationhttps://github.com/python/mypy/pull/1939
Commits26 (26)https://github.com/python/mypy/pull/1939/commits
Checkshttps://github.com/python/mypy/pull/1939/checks
Files changedhttps://github.com/python/mypy/pull/1939/files
Add NewTypehttps://github.com/python/mypy/pull/1939#top
gvanrossumhttps://github.com/gvanrossum
python:masterhttps://github.com/python/mypy/tree/master
Michael0x2a:add-newtypehttps://github.com/Michael0x2a/mypy/tree/add-newtype
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jul 26, 2016https://github.com/python/mypy/pull/1939#issue-167495793
Please reload this pagehttps://github.com/python/mypy/pull/1939
PEP 484https://www.python.org/dev/peps/pep-0484/#newtype-helper-function
#1284https://github.com/python/mypy/issues/1284
#1284https://github.com/python/mypy/issues/1284
Please reload this pagehttps://github.com/python/mypy/pull/1939
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jul 27, 2016https://github.com/python/mypy/pull/1939#event-735768037
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jul 27, 2016https://github.com/python/mypy/pull/1939#event-735931714
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jul 27, 2016https://github.com/python/mypy/pull/1939#event-735935781
MichaelLeeDBXhttps://github.com/MichaelLeeDBX
July 27, 2016 09:54https://github.com/python/mypy/pull/1939#commits-pushed-965531f
https://github.com/MichaelLeeDBX
Add NewVarExpr nodehttps://github.com/python/mypy/pull/1939/commits/965531f1fb174983a29beb42264d381dc1638ba4
965531fhttps://github.com/python/mypy/pull/1939/commits/965531f1fb174983a29beb42264d381dc1638ba4
https://github.com/MichaelLeeDBX
Modify NameExpr, get prelim version workinghttps://github.com/python/mypy/pull/1939/commits/59471ce5dd90e4a28b557eaa900dc0a70f08de37
59471cehttps://github.com/python/mypy/pull/1939/commits/59471ce5dd90e4a28b557eaa900dc0a70f08de37
https://github.com/MichaelLeeDBX
Add basic tests for NewTypehttps://github.com/python/mypy/pull/1939/commits/a9c8205d549c6369c4501e8053b73d6a3780e0ea
a9c8205https://github.com/python/mypy/pull/1939/commits/a9c8205d549c6369c4501e8053b73d6a3780e0ea
https://github.com/MichaelLeeDBX
Fix lint errorhttps://github.com/python/mypy/pull/1939/commits/e8b1cd64f03df0c9368fca7cef8355592575821b
e8b1cd6https://github.com/python/mypy/pull/1939/commits/e8b1cd64f03df0c9368fca7cef8355592575821b
https://github.com/MichaelLeeDBX
Add is_newtype flag to nodes to mirror namedtuplehttps://github.com/python/mypy/pull/1939/commits/582c651cd90ae329e4b53c69a8f40438cc50a052
582c651https://github.com/python/mypy/pull/1939/commits/582c651cd90ae329e4b53c69a8f40438cc50a052
https://github.com/MichaelLeeDBX
Add some incomplete tests for NewTypehttps://github.com/python/mypy/pull/1939/commits/eea40bf35ea3c7029a923765f54f64f9e138a882
eea40bfhttps://github.com/python/mypy/pull/1939/commits/eea40bf35ea3c7029a923765f54f64f9e138a882
https://github.com/MichaelLeeDBX
Add refinements to semantic analysis for NewTypehttps://github.com/python/mypy/pull/1939/commits/2f604a09b4b626bf4562fbb8d1f45830a48f2548
2f604a0https://github.com/python/mypy/pull/1939/commits/2f604a09b4b626bf4562fbb8d1f45830a48f2548
https://github.com/MichaelLeeDBX
Fix error in testshttps://github.com/python/mypy/pull/1939/commits/868f90cf0b941039d0e85e6cf5ab585ffc3e4203
868f90chttps://github.com/python/mypy/pull/1939/commits/868f90cf0b941039d0e85e6cf5ab585ffc3e4203
https://github.com/MichaelLeeDBX
Add more testshttps://github.com/python/mypy/pull/1939/commits/c31e01da2b4cf2e956f7b9dab58f47eaca00ea76
c31e01dhttps://github.com/python/mypy/pull/1939/commits/c31e01da2b4cf2e956f7b9dab58f47eaca00ea76
https://github.com/MichaelLeeDBX
Modify NewType handling to fix bugshttps://github.com/python/mypy/pull/1939/commits/ccc1032989e6055b6c6ba1faab8d91c28cff644d
ccc1032https://github.com/python/mypy/pull/1939/commits/ccc1032989e6055b6c6ba1faab8d91c28cff644d
https://github.com/MichaelLeeDBX
Add tests to check for bad subtypinghttps://github.com/python/mypy/pull/1939/commits/b022eb3c9adc3f17cee3fbe968c6f19e0e43a79d
b022eb3https://github.com/python/mypy/pull/1939/commits/b022eb3c9adc3f17cee3fbe968c6f19e0e43a79d
https://github.com/MichaelLeeDBX
Modify semanal to catch bad subtyping with NewTypehttps://github.com/python/mypy/pull/1939/commits/06a4e9e9575e8b8efc980fc046fcfaf26fa1a219
06a4e9ehttps://github.com/python/mypy/pull/1939/commits/06a4e9e9575e8b8efc980fc046fcfaf26fa1a219
https://github.com/MichaelLeeDBX
Add test for namedtupleshttps://github.com/python/mypy/pull/1939/commits/385a4b69a43c4cba44dabe50f8bfc97e9bdb3dc9
385a4b6https://github.com/python/mypy/pull/1939/commits/385a4b69a43c4cba44dabe50f8bfc97e9bdb3dc9
https://github.com/MichaelLeeDBX
Add info about NewType to documentationhttps://github.com/python/mypy/pull/1939/commits/609746c2a1709ea031b467c7bcc9fcff55de0f7e
609746chttps://github.com/python/mypy/pull/1939/commits/609746c2a1709ea031b467c7bcc9fcff55de0f7e
https://github.com/MichaelLeeDBX
Remove unneeded code and importshttps://github.com/python/mypy/pull/1939/commits/7967bcffe3118429429b3dc255e42141ed67d0a4
7967bcfhttps://github.com/python/mypy/pull/1939/commits/7967bcffe3118429429b3dc255e42141ed67d0a4
https://github.com/MichaelLeeDBX
Rearrange newtype tests to be more logicalhttps://github.com/python/mypy/pull/1939/commits/0daf4863ec2173b27918131b24f0bc47df9f36e4
0daf486https://github.com/python/mypy/pull/1939/commits/0daf4863ec2173b27918131b24f0bc47df9f36e4
https://github.com/MichaelLeeDBX
Add test for NewType and Anyhttps://github.com/python/mypy/pull/1939/commits/d76b8daf414cee3a0dd02471564cb09e9a1c6314
d76b8dahttps://github.com/python/mypy/pull/1939/commits/d76b8daf414cee3a0dd02471564cb09e9a1c6314
https://github.com/MichaelLeeDBX
Rename variables and combine checks in semanalhttps://github.com/python/mypy/pull/1939/commits/c81477db23223138f49b7aa7b20e829bcf5fe9ff
c81477dhttps://github.com/python/mypy/pull/1939/commits/c81477db23223138f49b7aa7b20e829bcf5fe9ff
https://github.com/MichaelLeeDBX
Refactor newtype code in semenalhttps://github.com/python/mypy/pull/1939/commits/0995a30f839e79fe375b338bd9d9712720bad8da
0995a30https://github.com/python/mypy/pull/1939/commits/0995a30f839e79fe375b338bd9d9712720bad8da
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
force-pushedhttps://github.com/python/mypy/compare/ab588fbc8307b76460fbc1593efed5843e22d78f..0995a30f839e79fe375b338bd9d9712720bad8da
ab588fbhttps://github.com/python/mypy/commit/ab588fbc8307b76460fbc1593efed5843e22d78f
0995a30https://github.com/python/mypy/commit/0995a30f839e79fe375b338bd9d9712720bad8da
Compare https://github.com/python/mypy/compare/ab588fbc8307b76460fbc1593efed5843e22d78f..0995a30f839e79fe375b338bd9d9712720bad8da
July 27, 2016 16:56https://github.com/python/mypy/pull/1939#event-736708489
gvanrossumhttps://github.com/gvanrossum
Jul 27, 2016 https://github.com/python/mypy/pull/1939#discussion-diff-72490773
View reviewed changes https://github.com/python/mypy/pull/1939/files/0995a30f839e79fe375b338bd9d9712720bad8da#diff-ecca61fc614eaf632d42d6b116685cabd4949fe3461c0821cc05514d63eb1e97
docs/source/kinds_of_types.rsthttps://github.com/python/mypy/pull/1939/files#diff-ecca61fc614eaf632d42d6b116685cabd4949fe3461c0821cc05514d63eb1e97
gvanrossumhttps://github.com/gvanrossum
Jul 27, 2016https://github.com/python/mypy/pull/1939#discussion_r72490773
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/1939
gvanrossumhttps://github.com/gvanrossum
Jul 27, 2016 https://github.com/python/mypy/pull/1939#discussion-diff-72500657
View reviewed changes https://github.com/python/mypy/pull/1939/files/0995a30f839e79fe375b338bd9d9712720bad8da#diff-f782aad4853edceb67a88efe43d2869579d075a77b8e8dd2add91e818a9fa164
mypy/semanal.pyhttps://github.com/python/mypy/pull/1939/files#diff-f782aad4853edceb67a88efe43d2869579d075a77b8e8dd2add91e818a9fa164
gvanrossumhttps://github.com/gvanrossum
Jul 27, 2016https://github.com/python/mypy/pull/1939#discussion_r72500657
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/1939
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
Jul 27, 2016https://github.com/python/mypy/pull/1939#issuecomment-235718038
Please reload this pagehttps://github.com/python/mypy/pull/1939
MichaelLeeDBXhttps://github.com/MichaelLeeDBX
July 27, 2016 18:10https://github.com/python/mypy/pull/1939#commits-pushed-c37520b
https://github.com/MichaelLeeDBX
Clarify info in documentationhttps://github.com/python/mypy/pull/1939/commits/c37520b6f27d1eab9ed93ca8bc4b2208d9de6323
c37520bhttps://github.com/python/mypy/pull/1939/commits/c37520b6f27d1eab9ed93ca8bc4b2208d9de6323
https://github.com/MichaelLeeDBX
Remove unnecessary extra codehttps://github.com/python/mypy/pull/1939/commits/0eb700aa68cd432f60fed35abcec601bdc4f97a3
0eb700ahttps://github.com/python/mypy/pull/1939/commits/0eb700aa68cd432f60fed35abcec601bdc4f97a3
https://github.com/MichaelLeeDBX
Refactor semanal codehttps://github.com/python/mypy/pull/1939/commits/90609af36ad0db0ee6b94deec947d19bc366f1f2
90609afhttps://github.com/python/mypy/pull/1939/commits/90609af36ad0db0ee6b94deec947d19bc366f1f2
https://github.com/MichaelLeeDBX
Fix lint errorshttps://github.com/python/mypy/pull/1939/commits/578c8453db28f5cd1b057fe367f678404d1c8b01
578c845https://github.com/python/mypy/pull/1939/commits/578c8453db28f5cd1b057fe367f678404d1c8b01
https://github.com/MichaelLeeDBX
Fix tests based on new error messagehttps://github.com/python/mypy/pull/1939/commits/b2732503b4b194b84f39659ac1c161b89f7e501e
b273250https://github.com/python/mypy/pull/1939/commits/b2732503b4b194b84f39659ac1c161b89f7e501e
https://github.com/MichaelLeeDBX
Update tests for newtype to respond to code reviewhttps://github.com/python/mypy/pull/1939/commits/c71aafaa485f6afe0bc9a69f92c0c0b825b75704
c71aafahttps://github.com/python/mypy/pull/1939/commits/c71aafaa485f6afe0bc9a69f92c0c0b825b75704
gvanrossumhttps://github.com/gvanrossum
Jul 28, 2016 https://github.com/python/mypy/pull/1939#discussion-diff-72558548
View reviewed changes https://github.com/python/mypy/pull/1939/files/c71aafaa485f6afe0bc9a69f92c0c0b825b75704#diff-ecca61fc614eaf632d42d6b116685cabd4949fe3461c0821cc05514d63eb1e97
docs/source/kinds_of_types.rsthttps://github.com/python/mypy/pull/1939/files#diff-ecca61fc614eaf632d42d6b116685cabd4949fe3461c0821cc05514d63eb1e97
gvanrossumhttps://github.com/gvanrossum
Jul 28, 2016https://github.com/python/mypy/pull/1939#discussion_r72558548
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/1939
https://github.com/MichaelLeeDBX
Respond to 2nd wave of code reviewhttps://github.com/python/mypy/pull/1939/commits/55617b9f9908023f4cd544cfa1f9bf056d63ffcd
55617b9https://github.com/python/mypy/pull/1939/commits/55617b9f9908023f4cd544cfa1f9bf056d63ffcd
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
2d3dc1ehttps://github.com/python/mypy/commit/2d3dc1e3f1e64acd3b53dd96d32b101954b8ade8
Jul 28, 2016https://github.com/python/mypy/pull/1939#event-737338244
https://github.com/ddfisher
ddfisherhttps://github.com/ddfisher
Aug 2, 2016https://github.com/python/mypy/pull/1939#issuecomment-237084073
Please reload this pagehttps://github.com/python/mypy/pull/1939
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
August 15, 2016 22:17https://github.com/python/mypy/pull/1939#event-756287138
https://github.co/hiddenchars
https://github.com/python/mypy/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F1939
Please reload this pagehttps://github.com/python/mypy/pull/1939
Type aliases without implicit conversion ("NewType") https://github.com/python/mypy/issues/1284
Please reload this pagehttps://github.com/python/mypy/pull/1939
https://github.com/Michael0x2a
https://github.com/gvanrossum
https://github.com/ddfisher
https://github.com/MichaelLeeDBX
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.