René's URL Explorer Experiment


Title: Question: Can I get mypy to type check in "strict and safe" as opposed to "best effort" style? · Issue #2780 · python/mypy · GitHub

Open Graph Title: Question: Can I get mypy to type check in "strict and safe" as opposed to "best effort" style? · Issue #2780 · python/mypy

X Title: Question: Can I get mypy to type check in "strict and safe" as opposed to "best effort" style? · Issue #2780 · python/mypy

Description: I don't know how typical a user of mypy I am, in that the thing I am using it for is to lean on its type system to give me feedback about a complex new program from the beginning, as opposed to retrofitting types onto an existing project...

Open Graph Description: I don't know how typical a user of mypy I am, in that the thing I am using it for is to lean on its type system to give me feedback about a complex new program from the beginning, as opposed to ret...

X Description: I don't know how typical a user of mypy I am, in that the thing I am using it for is to lean on its type system to give me feedback about a complex new program from the beginning, as opposed to...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Question: Can I get mypy to type check in \"strict and safe\" as opposed to \"best effort\" style?","articleBody":"I don't know how typical a user of mypy I am, in that the thing I am using it for is to lean on its type system to give me feedback about a complex new program from the beginning, as opposed to retrofitting types onto an existing project to look for bugs in it.  In my case, false negatives (i.e., failing to type check something, or silently giving something the wrong type) are much worse than false positives (loudly claiming a type error in code that actually executes fine).  I am also willing to adjust my program to a considerable degree to make it type-check, in part because I expect the result to be easier to read as well (and in part because I am used to programming in Haskell).  In return for that, I am looking for confidence that the program does not commit type errors, and therefore the architecture is reasonably sound, at least at the type level.\r\n\r\nI can, however, imagine a large community of mypy users that are trying to use mypy to look for type errors in large existing programs, presumably incrementally.  In this case, false positives are very problematic, because too many too early would make the task of typing a program too difficult up front, without showing enough value early enough to make it seem worth it.  In light of this use case, I can certainly understand that mypy would lean toward admitting false negatives to reduce the rate of false positives by default (silently skipping non-annotated functions, silently inserting the Any type, etc).\r\n\r\nMy question is this: Is mypy intended to support the \"no false negatives\" use style?  If so, how can I get it to be as aggressive as possible?  I already found `--strict-optional --disallow-untyped-calls --check-untyped-defs`, but those seem like isolated \"stricter\" decisions in a sea of \"best effort\" defaults.  Ideally, I would like to get mypy to complain loudly about every little place where some construct is problematic.  \r\n\r\nOne specific example is Issue #2776.  That is a situation where the \"right thing to do\" depends on whether the user wants to avoid false positives or false negatives. It is also a sufficiently specific situation that it probably doesn't warrant a command line flag of its own, but it could reasonably be influenced by a global `--avoid-false-negatives` flag.\r\n\r\nFull disclosure: my real use case is a mixture.  The reason I am writing the program I want to type check so strictly in Python in the first place is because I want it to be able to call out to a substantial pile of (not type-checked) Python code my research group has already written (which I am willing to add type annotations to, and to modify locally, but less willing to substantially refactor based on feedback from the type checker).  So what I really want is per-file or per-function selection of whether to prefer a low false-negative or a low false-positive rate; but I can make do with a global setting :)","author":{"url":"https://github.com/axch","@type":"Person","name":"axch"},"datePublished":"2017-01-31T12:11:39Z","url":"https://github.com/python/mypy/issues/2780"}

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:29f0ff19-23ce-6323-6b09-8c35a66924e5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB2A4:1AC37C:4D4DB3:67A557:6B002F4C
html-safe-noncefd605fcd00aff2ea7dc0ed0be70ae25fe0966325115d4963c84adca6d5e896bd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkE0OjFBQzM3Qzo0RDREQjM6NjdBNTU3OjZCMDAyRjRDIiwidmlzaXRvcl9pZCI6IjcxNTQ4ODI0Mzg0NzUyOTY1ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbed0ff200b860e6fbd2944ee3972cc44e1c82ea28fed5d2ce5e116b4e04fab4e
hovercard-subject-tagissue:204278147
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/2780/issue_layout
twitter:imagehttps://opengraph.githubassets.com/442e23ca075859e1ffc9d104c84c5ca36ed32960c400d0ceba314db24f1968b6/python/mypy/issues/2780
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/442e23ca075859e1ffc9d104c84c5ca36ed32960c400d0ceba314db24f1968b6/python/mypy/issues/2780
og:image:altI don't know how typical a user of mypy I am, in that the thing I am using it for is to lean on its type system to give me feedback about a complex new program from the beginning, as opposed to ret...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaxch
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/2780#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F2780
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%2F2780
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/2780
Reloadhttps://github.com/python/mypy/issues/2780
Reloadhttps://github.com/python/mypy/issues/2780
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
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/2780
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/2780
Question: Can I get mypy to type check in "strict and safe" as opposed to "best effort" style?https://github.com/python/mypy/issues/2780#top
https://github.com/axch
axchhttps://github.com/axch
on Jan 31, 2017https://github.com/python/mypy/issues/2780#issue-204278147
#2776https://github.com/python/mypy/issues/2776
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Feb 1, 2017https://github.com/python/mypy/issues/2780#issuecomment-276616767
#2696https://github.com/python/mypy/issues/2696
https://github.com/axch
axchhttps://github.com/axch
on Feb 1, 2017https://github.com/python/mypy/issues/2780#issuecomment-276639157
axchhttps://github.com/axch
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Feb 1, 2017https://github.com/python/mypy/issues/2780#event-944622258
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/2780
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/2780
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.