René's URL Explorer Experiment


Title: [1.20 regression] reachability in django-modern-rest · Issue #21132 · python/mypy · GitHub

Open Graph Title: [1.20 regression] reachability in django-modern-rest · Issue #21132 · python/mypy

X Title: [1.20 regression] reachability in django-modern-rest · Issue #21132 · python/mypy

Description: Hi! I am facing 150+ errors in my project https://github.com/wemake-services/django-modern-rest after updating mypy to 1.20 from 1.19. Here are the most frequest ones: lru_cache issues dmr/response.py:236: error: Cannot determine type of...

Open Graph Description: Hi! I am facing 150+ errors in my project https://github.com/wemake-services/django-modern-rest after updating mypy to 1.20 from 1.19. Here are the most frequest ones: lru_cache issues dmr/response...

X Description: Hi! I am facing 150+ errors in my project https://github.com/wemake-services/django-modern-rest after updating mypy to 1.20 from 1.19. Here are the most frequest ones: lru_cache issues dmr/response...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[1.20 regression] reachability in django-modern-rest","articleBody":"Hi!\n\nI am facing 150+ errors in my project https://github.com/wemake-services/django-modern-rest after updating mypy to `1.20` from `1.19.`\n\nHere are the most frequest ones:\n\n## lru_cache issues\n\n```\ndmr/response.py:236: error: Cannot determine type of \"resolve_setting\"  [has-type]\ndmr/response.py:236: note: Revealed type is \"Any\"\ndmr/response.py:237: error: Cannot determine type of \"resolve_setting\"  [has-type]\ndmr/routing.py:108: error: Cannot determine type of \"resolve_setting\"  [has-type]\ndmr/routing.py:190: error: Cannot determine type of \"resolve_setting\"  [has-type]\ndmr/parsers.py:232: error: Cannot determine type of \"resolve_setting\"  [has-type]\ndmr/parsers.py:284: error: Cannot determine type of \"resolve_setting\"  [has-type]\n```\n\nFor some reason all code that is using [`resolve_setting`](https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/routing.py#L107-L109) fails with this error:\n\n```python\nrenderers_list = (\n    resolve_setting(Settings.renderers) if renderers is None else renderers\n)\n```\n\nHere's how [it is defined](https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/settings.py#L168):\n\n```python\n@lru_cache(maxsize=MAX_CACHE_SIZE)\ndef resolve_setting(\n    setting_name: Settings,\n    *,\n    import_string: bool = False,\n) -\u003e Any:\n    \"\"\"\n    Resolves setting by *setting_name*.\n\n    The result is cached using ``@lru_cache`` for performance.\n    When testing with custom settings, you *must* call\n    :func:`clear_settings_cache` before and after modifying\n    Django settings to ensure the cache is invalidated properly.\n    \"\"\"\n    setting = _resolve_defaults().get(\n        setting_name,\n        _DEFAULTS[setting_name],\n    )\n    if import_string and isinstance(setting, str):\n        return module_loading.import_string(setting)\n    return setting  # pyright: ignore[reportUnknownVariableType]\n```\n\nMaybe `@lru_cache(maxsize=MAX_CACHE_SIZE)` is the root cause? If I remove this decorator - all errors are gone.\n\nWe also faced a similiar problem in our `django-stubs` PR: https://github.com/typeddjango/django-stubs/pull/3252#discussion_r3018408038\n\n## Unreachable\n\nI have more than 120+ errors that some statements are unreachable.\nExamples:\n\n```\n(.venv) ~/Desktop/django-modern-rest  master ✗                                         1 ⚠️\n» mypy dmr\ndmr/settings.py:122: error: Statement is unreachable  [unreachable]\ndmr/validation/settings.py:41: error: Statement is unreachable  [unreachable]\n```\n\n1. https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/settings.py#L122\n2. https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/validation/settings.py#L41\n\nThese are two different module-level definitions. Not sure what is the root cause here :(\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2026-04-01T08:51:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/21132/mypy/issues/21132"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:664ed7b9-7e6d-752b-5ff9-819e835924d0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED9A:15719E:5581A:7C9AF:6A58A169
html-safe-nonce953270f2f23ae5a110a6f70bacc980145f1157bc370c5b7abcf7494f5a57546e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDlBOjE1NzE5RTo1NTgxQTo3QzlBRjo2QTU4QTE2OSIsInZpc2l0b3JfaWQiOiIzMDk0MzgxNzYyMjQ5NzkzODk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaceaef02f2f8e0902684c4aa44e56c2f2c09154ff602108be4c912a90be5f1c198
hovercard-subject-tagissue:4185263013
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/21132/issue_layout
twitter:imagehttps://opengraph.githubassets.com/922c3b323dd2616fe6681d409f0508da8e9365dc14ed0d28b81ddf1dfacf958d/python/mypy/issues/21132
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/922c3b323dd2616fe6681d409f0508da8e9365dc14ed0d28b81ddf1dfacf958d/python/mypy/issues/21132
og:image:altHi! I am facing 150+ errors in my project https://github.com/wemake-services/django-modern-rest after updating mypy to 1.20 from 1.19. Here are the most frequest ones: lru_cache issues dmr/response...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesobolevn
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
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
release7d699f0c51c1f58938601870a21967b74eaad94d
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/mypy/issues/21132#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F21132
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F21132
Sign up https://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/21132
Reloadhttps://github.com/python/mypy/issues/21132
Reloadhttps://github.com/python/mypy/issues/21132
Please reload this pagehttps://github.com/python/mypy/issues/21132
python https://github.com/python
mypyhttps://github.com/python/mypy
Please reload this pagehttps://github.com/python/mypy/issues/21132
Notifications https://github.com/login?return_to=%2Fpython%2Fmypy
Fork 3.2k https://github.com/login?return_to=%2Fpython%2Fmypy
Star 20.5k https://github.com/login?return_to=%2Fpython%2Fmypy
Code https://github.com/python/mypy
Issues 2.7k https://github.com/python/mypy/issues
Pull requests 465 https://github.com/python/mypy/pulls
Actions https://github.com/python/mypy/actions
Projects https://github.com/python/mypy/projects
Wiki https://github.com/python/mypy/wiki
Security and quality 0 https://github.com/python/mypy/security
Insights https://github.com/python/mypy/pulse
Code https://github.com/python/mypy
Issues https://github.com/python/mypy/issues
Pull requests https://github.com/python/mypy/pulls
Actions https://github.com/python/mypy/actions
Projects https://github.com/python/mypy/projects
Wiki https://github.com/python/mypy/wiki
Security and quality https://github.com/python/mypy/security
Insights https://github.com/python/mypy/pulse
[1.20 regression] reachability in django-modern-resthttps://github.com/python/mypy/issues/21132#top
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-reachabilityDetecting unreachable codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-reachability%22
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
on Apr 1, 2026https://github.com/python/mypy/issues/21132#issue-4185263013
https://github.com/wemake-services/django-modern-resthttps://github.com/wemake-services/django-modern-rest
resolve_settinghttps://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/routing.py#L107-L109
it is definedhttps://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/settings.py#L168
typeddjango/django-stubs#3252 (comment)https://github.com/typeddjango/django-stubs/pull/3252#discussion_r3018408038
https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/settings.py#L122https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/settings.py#L122
https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/validation/settings.py#L41https://github.com/wemake-services/django-modern-rest/blob/9062072376962f8b9ba6e195244ca702fe3d15e8/dmr/validation/settings.py#L41
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-reachabilityDetecting unreachable codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-reachability%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.