Title: Type variable substitution in type instances · Issue #156 · python/typing · GitHub
Open Graph Title: Type variable substitution in type instances · Issue #156 · python/typing
X Title: Type variable substitution in type instances · Issue #156 · python/typing
Description: [In http://bugs.python.org/issue25087 Stefan Krah wrote:] If a type scheme is instantiated, should the type variables in the class body be substituted? This is an example (typed by hand on a locked down Windows machine, may contain error...
Open Graph Description: [In http://bugs.python.org/issue25087 Stefan Krah wrote:] If a type scheme is instantiated, should the type variables in the class body be substituted? This is an example (typed by hand on a locked...
X Description: [In http://bugs.python.org/issue25087 Stefan Krah wrote:] If a type scheme is instantiated, should the type variables in the class body be substituted? This is an example (typed by hand on a locked...
Opengraph URL: https://github.com/python/typing/issues/156
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type variable substitution in type instances","articleBody":"[In http://bugs.python.org/issue25087 Stefan Krah wrote:]\n\nIf a type scheme is instantiated, should the type variables in the\nclass body be substituted? This is an example (typed by hand on\na locked down Windows machine, may contain errors):\n\n```\nalpha = TypeVar('alpha')\nbeta = TypeVar('beta')\n\nclass ABTuple(Generic[alpha, beta]):\n def __init__(self, a : alpha, b : beta):\n self.value = (a, b)\n\nget_type_hints(ABTuple.__init__)\n ==> {'b': ~beta, 'a': ~alpha}\n\n\nIntIntTuple = ABTuple[int, int]\n\nIntIntTuple\n ==> __main__.ABTuple[int, int]\n\nget_type_hints(IntIntTuple.__init__)\n{'b': ~beta, 'a': ~alpha}\n ^^^^^^ ^^^^^^\n```\n\nSince the type has been specialized, these should ideally be 'int'.\n","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2015-09-13T17:39:43Z","url":"https://github.com/python/typing/issues/156"}
| 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:9fc90cc4-0918-762d-f509-4df793e39b38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACF6:4D1C6:1EA501D:2997E39:6B0016BB |
| html-safe-nonce | f3c431363e9d8be17b381fb88d69bfbf009a438c7cb7ffc336b1c446335b804b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0Y2OjREMUM2OjFFQTUwMUQ6Mjk5N0UzOTo2QjAwMTZCQiIsInZpc2l0b3JfaWQiOiIzOTM5NzQ4MjYwODkzMTY5MzM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 590fc14b6a5ee1b32d31d70f381ba837b3c336eae8fa96f7d52245759a12351c |
| hovercard-subject-tag | issue:106229480 |
| 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/156/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5981b65977bdc459f2dee337037827878cebf0d08aeb7922ae2fdfbabc6cc6a9/python/typing/issues/156 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5981b65977bdc459f2dee337037827878cebf0d08aeb7922ae2fdfbabc6cc6a9/python/typing/issues/156 |
| og:image:alt | [In http://bugs.python.org/issue25087 Stefan Krah wrote:] If a type scheme is instantiated, should the type variables in the class body be substituted? This is an example (typed by hand on a locked... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| 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