René's URL Explorer Experiment


Title: How to use _typeshed.wsgi with typing.get_type_hints · Issue #11004 · python/typeshed · GitHub

Open Graph Title: How to use _typeshed.wsgi with typing.get_type_hints · Issue #11004 · python/typeshed

X Title: How to use _typeshed.wsgi with typing.get_type_hints · Issue #11004 · python/typeshed

Description: Hello there, is there a way to get to work combination of _typeshed.wsgi and typing.get_type_hints in runtime? In flask codebase there is something like from __future__ import annotations import typing as t if t.TYPE_CHECKING: # pragma: ...

Open Graph Description: Hello there, is there a way to get to work combination of _typeshed.wsgi and typing.get_type_hints in runtime? In flask codebase there is something like from __future__ import annotations import ty...

X Description: Hello there, is there a way to get to work combination of _typeshed.wsgi and typing.get_type_hints in runtime? In flask codebase there is something like from __future__ import annotations import ty...

Opengraph URL: https://github.com/python/typeshed/issues/11004

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to use _typeshed.wsgi with typing.get_type_hints","articleBody":"Hello there,\r\nis there a way to get to work combination of `_typeshed.wsgi` and `typing.get_type_hints` in runtime?\r\nIn flask codebase there is something like\r\n```py\r\nfrom __future__ import annotations\r\n\r\nimport typing as t\r\n\r\nif t.TYPE_CHECKING:  # pragma: no cover\r\n    from _typeshed.wsgi import WSGIApplication  # noqa: F401\r\n    from werkzeug.datastructures import Headers  # noqa: F401\r\n    from werkzeug.sansio.response import Response  # noqa: F401\r\n\r\n# The possible types that are directly convertible or are a Response object.\r\nResponseValue = t.Union[\r\n    \"Response\",\r\n    str,\r\n    bytes,\r\n    t.List[t.Any],\r\n    # Only dict is actually accepted, but Mapping allows for TypedDict.\r\n    t.Mapping[str, t.Any],\r\n    t.Iterator[str],\r\n    t.Iterator[bytes],\r\n]\r\n\r\n# the possible types for an individual HTTP header\r\n# This should be a Union, but mypy doesn't pass unless it's a TypeVar.\r\nHeaderValue = t.Union[str, t.List[str], t.Tuple[str, ...]]\r\n\r\n# the possible types for HTTP headers\r\nHeadersValue = t.Union[\r\n    \"Headers\",\r\n    t.Mapping[str, HeaderValue],\r\n    t.Sequence[t.Tuple[str, HeaderValue]],\r\n]\r\n\r\n# The possible types returned by a route function.\r\nResponseReturnValue = t.Union[\r\n    ResponseValue,\r\n    t.Tuple[ResponseValue, HeadersValue],\r\n    t.Tuple[ResponseValue, int],\r\n    t.Tuple[ResponseValue, int, HeadersValue],\r\n    \"WSGIApplication\",\r\n]\r\n```\r\nhttps://github.com/pallets/flask/blob/3.0.0/src/flask/typing.py\r\nand in my application I use something like\r\n```py\r\nfrom flask.typing import ResponseReturnValue\r\n\r\n@inject\r\ndef my_endpoint() -> ResponseReturnValue:\r\n    return \"asdf\"\r\n\r\n...\r\ndef inject(method):\r\n    ...\r\n    arg_types = typing.get_type_hints(method)\r\n    # get args from DI container and call actual function with injected args\r\n```\r\nwhich ends with error like\r\n```\r\nNameError: name 'Response' is not defined\r\n```\r\nHere is complete playground for my issue https://www.online-python.com/AsZX867MEO\r\n\r\nI can probably use my own type for that - that's why I ask here - but not sure how to use typeshed in runtime.\r\nThen I can probably send PR directly to flask with fix for such edge cases (as nobody probably encountered this based on how long this is in flask already).\r\n\r\nThanks for you tips and help in advice.","author":{"url":"https://github.com/adaamz","@type":"Person","name":"adaamz"},"datePublished":"2023-11-09T23:09:10Z","url":"https://github.com/python/typeshed/issues/11004"}

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:e49262cf-87a1-ede8-46eb-e417d09dddcd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9758:1D6507:5256C9:6A4D2B:6AFFC230
html-safe-noncefcd0acbaaef08e55ad6fc9f427a4d1cef3a5b270215efdec59240d8fa1cbb260
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzU4OjFENjUwNzo1MjU2Qzk6NkE0RDJCOjZBRkZDMjMwIiwidmlzaXRvcl9pZCI6IjEwMzY0NjQ2NzA3NjE3OTYxNDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc813431a9d8e0686dc50ed006a0162b38dfbdc9cfe536ab06a688cfd7268d018
hovercard-subject-tagissue:1986557350
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/typeshed/11004/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ebe8422c35ae8c1d7ed60e77634ed941788ad22923e1842ddfd8a01d627546e6/python/typeshed/issues/11004
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ebe8422c35ae8c1d7ed60e77634ed941788ad22923e1842ddfd8a01d627546e6/python/typeshed/issues/11004
og:image:altHello there, is there a way to get to work combination of _typeshed.wsgi and typing.get_type_hints in runtime? In flask codebase there is something like from __future__ import annotations import ty...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameadaamz
hostnamegithub.com
expected-hostnamegithub.com
None1e805b832df235bb21305db712c3b6432920019dfc12cb25b9cb8d3b0c9403cf
turbo-cache-controlno-preview
go-importgithub.com/python/typeshed git https://github.com/python/typeshed.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id31696383
octolytics-dimension-repository_nwopython/typeshed
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31696383
octolytics-dimension-repository_network_root_nwopython/typeshed
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
release8fa4a54e6871c7908eda1c246ad5972982c0b59d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typeshed/issues/11004#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F11004
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%2Ftypeshed%2Fissues%2F11004
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%2Ftypeshed
Reloadhttps://github.com/python/typeshed/issues/11004
Reloadhttps://github.com/python/typeshed/issues/11004
Reloadhttps://github.com/python/typeshed/issues/11004
pythonhttps://github.com/python
typeshedhttps://github.com/python/typeshed
Codehttps://github.com/python/typeshed
Issues196 (196)https://github.com/python/typeshed/issues
Pull requests249 (249)https://github.com/python/typeshed/pulls
Actionshttps://github.com/python/typeshed/actions
Security and qualityhttps://github.com/python/typeshed/security
Insightshttps://github.com/python/typeshed/insights
https://github.com/python/typeshed
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/11004
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/11004
How to use _typeshed.wsgi with typing.get_type_hintshttps://github.com/python/typeshed/issues/11004#top
https://github.com/adaamz
adaamzhttps://github.com/adaamz
on Nov 9, 2023https://github.com/python/typeshed/issues/11004#issue-1986557350
https://github.com/pallets/flask/blob/3.0.0/src/flask/typing.pyhttps://github.com/pallets/flask/blob/3.0.0/src/flask/typing.py
https://www.online-python.com/AsZX867MEOhttps://www.online-python.com/AsZX867MEO
JelleZijlstrahttps://github.com/JelleZijlstra
on Nov 10, 2023https://github.com/python/typeshed/issues/11004#event-10919642424
CONTRIBUTING: Add @deprecated, other updateshttps://github.com/JelleZijlstra/typeshed/commit/dc3b09a5c923fcca8297eb775bdcd415a1062f6c
@deprecatedhttps://github.com/deprecated
https://docs.github.com/articles/closing-issues-via-commit-messages
dc3b09ahttps://github.com/JelleZijlstra/typeshed/commit/dc3b09a5c923fcca8297eb775bdcd415a1062f6c
https://github.com/Daverball
Daverballhttps://github.com/Daverball
on Nov 12, 2023https://github.com/python/typeshed/issues/11004#issuecomment-1807098120
@adaamzhttps://github.com/adaamz
https://github.com/adaamz
adaamzhttps://github.com/adaamz
on Nov 12, 2023https://github.com/python/typeshed/issues/11004#issuecomment-1807131764
@Daverballhttps://github.com/Daverball
https://github.com/Daverball
Daverballhttps://github.com/Daverball
on Nov 12, 2023https://github.com/python/typeshed/issues/11004#issuecomment-1807134169
https://discuss.python.org/t/dealing-with-forward-refs-at-runtime/37558https://discuss.python.org/t/dealing-with-forward-refs-at-runtime/37558
https://github.com/python/cpython/blob/3.12/Lib/typing.py#L2139https://github.com/python/cpython/blob/3.12/Lib/typing.py#L2139
JelleZijlstrahttps://github.com/JelleZijlstra
completedhttps://github.com/python/typeshed/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
5fd2e9bhttps://github.com/python/typeshed/commit/5fd2e9bf618c735afbf09730d7a862414144a8c7
on Nov 18, 2023https://github.com/python/typeshed/issues/11004#event-11002465181
https://github.com/Akuli
Akulihttps://github.com/Akuli
on Nov 19, 2023https://github.com/python/typeshed/issues/11004#issuecomment-1817712655
Akulihttps://github.com/Akuli
on Nov 19, 2023https://github.com/python/typeshed/issues/11004#event-11002829644
areslerhttps://github.com/aresler
on Jan 26, 2024https://github.com/python/typeshed/issues/11004#event-11614289603
CONTRIBUTING: Add @deprecated, other updates (python#11005)https://github.com/aresler/typeshed/commit/5fd2e9bf618c735afbf09730d7a862414144a8c7
@deprecatedhttps://github.com/deprecated
python#11005https://github.com/python/typeshed/pull/11005
https://docs.github.com/articles/closing-issues-via-commit-messages
5fd2e9bhttps://github.com/aresler/typeshed/commit/5fd2e9bf618c735afbf09730d7a862414144a8c7
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typeshed/issues/11004
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typeshed/issues/11004
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.