Title: Is it still necessary to prohibit generics at runtime? · Issue #303 · python/typing · GitHub
Open Graph Title: Is it still necessary to prohibit generics at runtime? · Issue #303 · python/typing
X Title: Is it still necessary to prohibit generics at runtime? · Issue #303 · python/typing
Description: There is a paragraph in PEP 484: You cannot use the subscripted class (e.g. ``Node[int]``) directly in an expression -- you must define a type alias. (This restriction exists because creating the subscripted class, e.g. ``Node[int]``, is...
Open Graph Description: There is a paragraph in PEP 484: You cannot use the subscripted class (e.g. ``Node[int]``) directly in an expression -- you must define a type alias. (This restriction exists because creating the s...
X Description: There is a paragraph in PEP 484: You cannot use the subscripted class (e.g. ``Node[int]``) directly in an expression -- you must define a type alias. (This restriction exists because creating the s...
Opengraph URL: https://github.com/python/typing/issues/303
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Is it still necessary to prohibit generics at runtime?","articleBody":"There is a paragraph in PEP 484:\n\n```\nYou cannot use the subscripted class (e.g. ``Node[int]``) directly in\nan expression -- you must define a type alias. (This restriction\nexists because creating the subscripted class, e.g. ``Node[int]``, is\nan expensive operation -- usually many times as expensive as\nconstructing an instance of it. Using a type alias is also more\nreadable.)\n```\n\nHowever, `__getitem__` is cached for generics now and this leads to significant speedup (Guido reported up to 300x speedup in extreme cases). I think the above restriction is not necessary anymore and could be removed from the PEP.\n","author":{"url":"https://github.com/ilevkivskyi","@type":"Person","name":"ilevkivskyi"},"datePublished":"2016-10-18T21:56:05Z","url":"https://github.com/python/typing/issues/303"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d6757afc-78c1-db43-520f-37d785f9b2a5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C9E0:4D728:2C71E44:3A5A829:6B0016C6 |
| html-safe-nonce | d77a3820811f51f2ba5054502d40cf66305d39d1997ffb90531ed15e9d1e1030 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUUwOjRENzI4OjJDNzFFNDQ6M0E1QTgyOTo2QjAwMTZDNiIsInZpc2l0b3JfaWQiOiIxNTQ3ODc5NzE5NjIwMzE4OTE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 61768cffb8eb1ead1df1ab751c023b8afe5bc9c8322492e9005f9a364531e874 |
| hovercard-subject-tag | issue:183813620 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typing/303/issue_layout |
| twitter:image | https://opengraph.githubassets.com/000b78f4afe185539dc77f4b47dc9239b72a281bebdc707a939657d0382be206/python/typing/issues/303 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/000b78f4afe185539dc77f4b47dc9239b72a281bebdc707a939657d0382be206/python/typing/issues/303 |
| og:image:alt | There is a paragraph in PEP 484: You cannot use the subscripted class (e.g. ``Node[int]``) directly in an expression -- you must define a type alias. (This restriction exists because creating the s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilevkivskyi |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width