René's URL Explorer Experiment


Title: Controlling scope of build options · Issue #1235 · python/mypy · GitHub

Open Graph Title: Controlling scope of build options · Issue #1235 · python/mypy

X Title: Controlling scope of build options · Issue #1235 · python/mypy

Description: Currently the --implicit-any mode flag is global, as it uniformly affects how mypy processes every file in a mypy run. Other global flags are being considered or implemented, including --strict and the "weak mode". Similarly, we could ha...

Open Graph Description: Currently the --implicit-any mode flag is global, as it uniformly affects how mypy processes every file in a mypy run. Other global flags are being considered or implemented, including --strict and...

X Description: Currently the --implicit-any mode flag is global, as it uniformly affects how mypy processes every file in a mypy run. Other global flags are being considered or implemented, including --strict and...

Opengraph URL: https://github.com/python/mypy/issues/1235

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Controlling scope of build options","articleBody":"Currently the `--implicit-any` mode flag is global, as it uniformly affects how mypy processes every file in a mypy run. Other global flags are being considered or implemented, including `--strict` and the \"weak mode\". Similarly, we could have options to disable/enable individual errors/warnings. These kinds of mode flags have some inconvenient properties, and I elaborate on this below.\n\n**A. Combining type checked programs is hard**\n\nIt's hard to combine two independently developed codebases into a single type checked program, as it may be necessary to use the least common denominator options to type check the combined program without spurious warnings. Global flags effectively introduce multiple mypy dialects that aren't quite compatible. Using the least common denominator options is clearly not desirable as programmers likely chose to enable some options for their code for a good reason.\n\nIntegrating multiple pieces of code without loosening type checking may involve a lot of refactoring or adding `# type: ignore` comments.\n\n**B. Migrating to stricter type checking mode is hard**\n\nMigrating from the default mode to `--strict`, for example, would have to be performed for the whole code base to avoid generating warnings. If there is, say, millions of lines code, this can be a huge undertaking, and may require the co-operation of owners of every part of the codebase. It would be much nicer to migrate to stricter options gradually, similar to how mypy supports migration from dynamic to static typing in small increments. This would also give more flexibility to owners of particular modules.\n\n**C. Options aren't self-documenting**\n\nWhen just looking at a source file, it's not obvious under which options it's supposed to type checked. This is less of a problem within a single, uniform codebase, but it becomes more important when combining code from multiple sources. It's easy to \"forget\" that some files should be checked in the strict mode when copying or moving source code, for example, since the knowledge lives in external configuration such as build scripts instead of being close to the physical code.\n\n---\n\nHere are some ways to overcome some of these problems:\n1. We type check code bases with different global options using separate mypy runs, stubbing out dependencies. So if codebases A and B have different global options, and A depends on B, we first type check B using the desired options and generate a set of stub files. We then separately type check A using a different set of options, and using stubs for B. This increases complexity and requires additional tooling to automatically generate stubs. Additionally, this doesn't significantly simplify the migration to stricter options within a single codebase.\n2. Provide fine grained configuration outside source files. For example, perhaps mypy will accept options such as `--strict=package1,package2` that will enforce some options for particular packages only. Alternatively, we could have a configuration file with rules such as `strict=package/**,module`, or perhaps even a hierarchy of such configuration files. This provides more flexibility but it makes it easy to forget to modify the configuration when adding new files or moving files around.\n3. Provide per-file option flags. We always default to some well-defined mode, and we support comments such as `# mypy: strict` near the top of the file that change mode options _for that file only_. This is very flexible and it makes files self-contained, but it's easy to forget to add the desired options to new files. We could also have a tool that enforces that certain options are always used in certain packages, similar to (2) above, in addition to per-file comments.\n4. Don't provide any options. Make the default mode \"good enough\" for most people.\n\nMy proposal is to choose some variant of option 3.\n\n---\n\nNote that I don't consider `--silent-import` a global option because it only affects files _not being processed_, so it's not really problematic in the same sense as the other options I discussed above.\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2016-02-23T09:20:53Z","url":"https://github.com/python/mypy/issues/1235"}

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/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a81b55a6-57e8-911f-ed28-4797c3b02a81
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAD30:2EC689:29D2FB7:38FAE01:6B004EE0
html-safe-nonce5d64fbffd8672d7a77fd474f97c45d93379c8fb4755d0544a17e76cf160fcd1c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDMwOjJFQzY4OToyOUQyRkI3OjM4RkFFMDE6NkIwMDRFRTAiLCJ2aXNpdG9yX2lkIjoiMjk2MTQ0MjUxMjg4MDgxNTg0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac339a9e857ccc2f70d19d2782bd62a313109b523171cd39d664aea6da442cbea2
hovercard-subject-tagissue:135680854
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/1235/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c26dc42b10968d934897c812b0f8954d4b367df3f6f868a17de6ff40e1281db9/python/mypy/issues/1235
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c26dc42b10968d934897c812b0f8954d4b367df3f6f868a17de6ff40e1281db9/python/mypy/issues/1235
og:image:altCurrently the --implicit-any mode flag is global, as it uniformly affects how mypy processes every file in a mypy run. Other global flags are being considered or implemented, including --strict and...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJukkaL
hostnamegithub.com
expected-hostnamegithub.com
Nonef9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b
turbo-cache-controlno-preview
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
releaseb27c5dde30676028abd5c5fc53ce5c9b625f8281
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/1235#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F1235
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%2Fissues%2F1235
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/1235
Reloadhttps://github.com/python/mypy/issues/1235
Reloadhttps://github.com/python/mypy/issues/1235
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
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/1235
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/1235
Controlling scope of build optionshttps://github.com/python/mypy/issues/1235#top
needs discussionhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22needs%20discussion%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Feb 23, 2016https://github.com/python/mypy/issues/1235#issue-135680854
JukkaLhttps://github.com/JukkaL
needs discussionhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22needs%20discussion%22
on Feb 23, 2016https://github.com/python/mypy/issues/1235#event-561276585
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Feb 23, 2016https://github.com/python/mypy/issues/1235#issuecomment-187840815
…https://github.com/python/mypy/issues/1235
https://github.com/ddfisher
ddfisherhttps://github.com/ddfisher
on Feb 23, 2016https://github.com/python/mypy/issues/1235#issuecomment-187905585
gnpricehttps://github.com/gnprice
on Mar 1, 2016https://github.com/python/mypy/issues/1235#event-573871678
ddfisherhttps://github.com/ddfisher
on Mar 1, 2016https://github.com/python/mypy/issues/1235#event-573888393
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 23, 2016https://github.com/python/mypy/issues/1235#issuecomment-249286830
gvanrossumhttps://github.com/gvanrossum
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
on Jan 6, 2017https://github.com/python/mypy/issues/1235#event-914705475
gvanrossumhttps://github.com/gvanrossum
on Mar 29, 2017https://github.com/python/mypy/issues/1235#event-1021273917
https://github.com/cpennington
cpenningtonhttps://github.com/cpennington
on May 21, 2017https://github.com/python/mypy/issues/1235#issuecomment-302953634
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on May 21, 2017https://github.com/python/mypy/issues/1235#issuecomment-302963809
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Jan 28, 2020https://github.com/python/mypy/issues/1235#issuecomment-579497956
JukkaLhttps://github.com/JukkaL
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 28, 2020https://github.com/python/mypy/issues/1235#event-2987529494
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/1235
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/1235
needs discussionhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22needs%20discussion%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
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.