René's URL Explorer Experiment


Title: Prohibit assignment to __class__ (Fixes #7724) by lsrafael13 · Pull Request #19180 · python/mypy · GitHub

Open Graph Title: Prohibit assignment to __class__ (Fixes #7724) by lsrafael13 · Pull Request #19180 · python/mypy

X Title: Prohibit assignment to __class__ (Fixes #7724) by lsrafael13 · Pull Request #19180 · python/mypy

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

Open Graph Description: Adds a type check that disallows assignments to class, which can lead to unsafe runtime behavior. Includes tests for class assignments and verifies that other dunder and regular attributes remain a...

X Description: Adds a type check that disallows assignments to class, which can lead to unsafe runtime behavior. Includes tests for class assignments and verifies that other dunder and regular attributes remain a...

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

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:299cd5f0-6dc7-ba6e-738c-20fe72852f03
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE17A:244A6A:BF1F04:F8C1E3:6AFFF236
html-safe-nonceb00ac460dccc50e6f308632c157e3d1fc2a7c6a2829c4ed293fa5ac87516e50b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTdBOjI0NEE2QTpCRjFGMDQ6RjhDMUUzOjZBRkZGMjM2IiwidmlzaXRvcl9pZCI6IjU2NzcyMDg5OTkwOTk4ODgxODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac61c24338674831f0cd9800c0305baec01017691e2957218fdf1a3e34c06cd244
hovercard-subject-tagpull_request:2555877368
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/19180/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/712d2c6a887290deb63de71a86f0424d21db897954e7712485c3382b166d914b/python/mypy/pull/19180
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/712d2c6a887290deb63de71a86f0424d21db897954e7712485c3382b166d914b/python/mypy/pull/19180
og:image:altAdds a type check that disallows assignments to class, which can lead to unsafe runtime behavior. Includes tests for class assignments and verifies that other dunder and regular attributes remain a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelsrafael13
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/19180#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F19180
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%2F19180
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/19180
Reloadhttps://github.com/python/mypy/pull/19180
Reloadhttps://github.com/python/mypy/pull/19180
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 requests547 (547)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
lsrafael13https://github.com/lsrafael13
python:masterhttps://github.com/python/mypy/tree/master
lsrafael13:issue-7724https://github.com/lsrafael13/mypy/tree/issue-7724
Conversationhttps://github.com/python/mypy/pull/19180
Commits7 (7)https://github.com/python/mypy/pull/19180/commits
Checkshttps://github.com/python/mypy/pull/19180/checks
Files changedhttps://github.com/python/mypy/pull/19180/files
Prohibit assignment to __class__ (Fixes #7724)https://github.com/python/mypy/pull/19180#top
lsrafael13https://github.com/lsrafael13
python:masterhttps://github.com/python/mypy/tree/master
lsrafael13:issue-7724https://github.com/lsrafael13/mypy/tree/issue-7724
https://github.com/lsrafael13
lsrafael13https://github.com/lsrafael13
May 30, 2025https://github.com/python/mypy/pull/19180#issue-3104480924
#7724https://github.com/python/mypy/issues/7724
Please reload this pagehttps://github.com/python/mypy/pull/19180
lsrafael13https://github.com/lsrafael13
May 30, 2025 20:12https://github.com/python/mypy/pull/19180#commits-pushed-59450e8
https://github.com/lsrafael13
Prohibit assignment to __class__ inside instance methodshttps://github.com/python/mypy/pull/19180/commits/59450e8a0c43def8bc619b23a1855c799382049e
59450e8https://github.com/python/mypy/pull/19180/commits/59450e8a0c43def8bc619b23a1855c799382049e
python#7724https://github.com/python/mypy/issues/7724
https://github.com/lsrafael13
Trigger GitHub Actions for testinghttps://github.com/python/mypy/pull/19180/commits/523a16849b61c967b17e3a7d49a82c2bc6d07d7a
523a168https://github.com/python/mypy/pull/19180/commits/523a16849b61c967b17e3a7d49a82c2bc6d07d7a
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F19180
https://github.com/lsrafael13
Fix AttributeError in VarAssignVisitor and cleanup test filehttps://github.com/python/mypy/pull/19180/commits/fe381b2779bee981f2d895ca57547d3c6c238b3e
fe381b2https://github.com/python/mypy/pull/19180/commits/fe381b2779bee981f2d895ca57547d3c6c238b3e
https://github.com/lsrafael13
lsrafael13https://github.com/lsrafael13
force-pushedhttps://github.com/python/mypy/compare/78886f54a3f815089235e736b4840767a13f2e03..fe381b2779bee981f2d895ca57547d3c6c238b3e
78886f5https://github.com/python/mypy/commit/78886f54a3f815089235e736b4840767a13f2e03
fe381b2https://github.com/python/mypy/commit/fe381b2779bee981f2d895ca57547d3c6c238b3e
Compare https://github.com/python/mypy/compare/78886f54a3f815089235e736b4840767a13f2e03..fe381b2779bee981f2d895ca57547d3c6c238b3e
June 1, 2025 19:09https://github.com/python/mypy/pull/19180#event-17917102219
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F19180
https://github.com/lsrafael13
Fix assignment to __class__ check to use errors.report() in VarAssign…https://github.com/python/mypy/pull/19180/commits/111a3c4ec60f6487e4247f61e8597d6befd528aa
111a3c4https://github.com/python/mypy/pull/19180/commits/111a3c4ec60f6487e4247f61e8597d6befd528aa
python#7724https://github.com/python/mypy/issues/7724
https://github.com/lsrafael13
lsrafael13https://github.com/lsrafael13
force-pushedhttps://github.com/python/mypy/compare/39644fe5250f9a0bf9b549927d17261e16e9fd3f..111a3c4ec60f6487e4247f61e8597d6befd528aa
39644fehttps://github.com/python/mypy/commit/39644fe5250f9a0bf9b549927d17261e16e9fd3f
111a3c4https://github.com/python/mypy/commit/111a3c4ec60f6487e4247f61e8597d6befd528aa
Compare https://github.com/python/mypy/compare/39644fe5250f9a0bf9b549927d17261e16e9fd3f..111a3c4ec60f6487e4247f61e8597d6befd528aa
June 1, 2025 20:52https://github.com/python/mypy/pull/19180#event-17918097886
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F19180
https://github.com/lsrafael13
Disallow assignment to '__class__' in TypeChecker.visit_assignment_stmthttps://github.com/python/mypy/pull/19180/commits/cd6d90b5526522bec63fbb64a45734d36f7baa1c
cd6d90bhttps://github.com/python/mypy/pull/19180/commits/cd6d90b5526522bec63fbb64a45734d36f7baa1c
python#7724https://github.com/python/mypy/issues/7724
https://github.com/lsrafael13
lsrafael13https://github.com/lsrafael13
force-pushedhttps://github.com/python/mypy/compare/5c60d664817bf22efa89f44c0b44282a2a4b9989..cd6d90b5526522bec63fbb64a45734d36f7baa1c
5c60d66https://github.com/python/mypy/commit/5c60d664817bf22efa89f44c0b44282a2a4b9989
cd6d90bhttps://github.com/python/mypy/commit/cd6d90b5526522bec63fbb64a45734d36f7baa1c
Compare https://github.com/python/mypy/compare/5c60d664817bf22efa89f44c0b44282a2a4b9989..cd6d90b5526522bec63fbb64a45734d36f7baa1c
June 2, 2025 20:00https://github.com/python/mypy/pull/19180#event-17942064276
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F19180
https://github.com/lsrafael13
Add __class__ assignment check to TypeChecker.visit_assignment_stmthttps://github.com/python/mypy/pull/19180/commits/78a6c991ab4b628718bc1097daf5a113b87bad48
78a6c99https://github.com/python/mypy/pull/19180/commits/78a6c991ab4b628718bc1097daf5a113b87bad48
python#7724https://github.com/python/mypy/issues/7724
https://github.com/lsrafael13
lsrafael13https://github.com/lsrafael13
force-pushedhttps://github.com/python/mypy/compare/7b2140ac2a803b08e31e29875f56fb3f3f9648f9..78a6c991ab4b628718bc1097daf5a113b87bad48
7b2140ahttps://github.com/python/mypy/commit/7b2140ac2a803b08e31e29875f56fb3f3f9648f9
78a6c99https://github.com/python/mypy/commit/78a6c991ab4b628718bc1097daf5a113b87bad48
Compare https://github.com/python/mypy/compare/7b2140ac2a803b08e31e29875f56fb3f3f9648f9..78a6c991ab4b628718bc1097daf5a113b87bad48
June 2, 2025 23:16https://github.com/python/mypy/pull/19180#event-17944927735
https://github.com/marketplace/pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hookshttps://github.com/python/mypy/pull/19180/commits/3a6b580ef14963c3f5f644aa83047e51091fdaf7
3a6b580https://github.com/python/mypy/pull/19180/commits/3a6b580ef14963c3f5f644aa83047e51091fdaf7
https://pre-commit.cihttps://pre-commit.ci
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Jun 2, 2025https://github.com/python/mypy/pull/19180#issuecomment-2932921069
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/19180
https://github.com/lsrafael13
lsrafael13https://github.com/lsrafael13
June 3, 2025 01:07https://github.com/python/mypy/pull/19180#event-17945795508
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Jun 3, 2025 https://github.com/python/mypy/pull/19180#pullrequestreview-2893735123
View reviewed changes https://github.com/python/mypy/pull/19180/files/3a6b580ef14963c3f5f644aa83047e51091fdaf7
sterliakovhttps://github.com/sterliakov
https://github.com/python/mypy/pull/19180#pullrequestreview-2893735123
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/19180
test-data/unit/check-assign-to-class.testhttps://github.com/python/mypy/pull/19180/files/3a6b580ef14963c3f5f644aa83047e51091fdaf7#diff-f51627dd9c7989cd5f1daeb36294c764c8bf28af55e98b066d2c8585de09e55b
sterliakovhttps://github.com/sterliakov
Jun 3, 2025https://github.com/python/mypy/pull/19180#discussion_r2124678946
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/19180
test-data/unit/check-assign-to-class.testhttps://github.com/python/mypy/pull/19180/files/3a6b580ef14963c3f5f644aa83047e51091fdaf7#diff-f51627dd9c7989cd5f1daeb36294c764c8bf28af55e98b066d2c8585de09e55b
sterliakovhttps://github.com/sterliakov
Jun 3, 2025https://github.com/python/mypy/pull/19180#discussion_r2124679501
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/19180
test-data/unit/check-assign-to-class.testhttps://github.com/python/mypy/pull/19180/files/3a6b580ef14963c3f5f644aa83047e51091fdaf7#diff-f51627dd9c7989cd5f1daeb36294c764c8bf28af55e98b066d2c8585de09e55b
sterliakovhttps://github.com/sterliakov
Jun 3, 2025https://github.com/python/mypy/pull/19180#discussion_r2124682387
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/19180
mypy/checker.pyhttps://github.com/python/mypy/pull/19180/files/3a6b580ef14963c3f5f644aa83047e51091fdaf7#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
sterliakovhttps://github.com/sterliakov
Jun 3, 2025https://github.com/python/mypy/pull/19180#discussion_r2124688394
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/19180
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Jun 3, 2025https://github.com/python/mypy/pull/19180#issuecomment-2936780986
#7724https://github.com/python/mypy/issues/7724
Please reload this pagehttps://github.com/python/mypy/pull/19180
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%2F19180
https://github.com/sterliakov
sterliakov https://github.com/sterliakov
https://github.com/python/mypy/pull/19180/files/3a6b580ef14963c3f5f644aa83047e51091fdaf7
Please reload this pagehttps://github.com/python/mypy/pull/19180
Refactor all member access to go through checkmember.py (meta issue) https://github.com/python/mypy/issues/7724
Please reload this pagehttps://github.com/python/mypy/pull/19180
https://github.com/lsrafael13
https://github.com/sterliakov
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.