Title: Specialized sub-classes of Generic never call __init__ · Issue #192 · python/typing · GitHub
Open Graph Title: Specialized sub-classes of Generic never call __init__ · Issue #192 · python/typing
X Title: Specialized sub-classes of Generic never call __init__ · Issue #192 · python/typing
Description: See http://bugs.python.org/issue26391 . """ A specialized sub-class of a generic type never calls __init__ when it is instantiated. See below for an example: from typing import Generic, TypeVar T = TypeVar('T') class Foo(Generic[T]): def...
Open Graph Description: See http://bugs.python.org/issue26391 . """ A specialized sub-class of a generic type never calls __init__ when it is instantiated. See below for an example: from typing import Generic, TypeVar T =...
X Description: See http://bugs.python.org/issue26391 . """ A specialized sub-class of a generic type never calls __init__ when it is instantiated. See below for an example: from typing import Gener...
Opengraph URL: https://github.com/python/typing/issues/192
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Specialized sub-classes of Generic never call __init__","articleBody":"See http://bugs.python.org/issue26391 .\n\n\"\"\"\nA specialized sub-class of a generic type never calls `__init__` when it is instantiated. See below for an example:\n\n``` python\nfrom typing import Generic, TypeVar\n\nT = TypeVar('T')\nclass Foo(Generic[T]):\n def __init__(self, value: T):\n self.value = value\n\nBar = Foo[str]\n\nfoo = Foo('foo')\nbar = Bar('bar')\n\nprint(type(foo), end=' ')\nprint(foo.value)\n\nprint(type(bar), end=' ')\nprint(bar.value) # AttributeError\n```\n\nI would expect Foo[str], Foo[int], etc to be equivalent to Foo at run-time. If this is not the case it might deserve an explicit mention in the docs. At the moment, behaviour is confusing because an instance of Foo is returned that does not have any of its attributes set.\n\"\"\"\n","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2016-03-23T20:43:25Z","url":"https://github.com/python/typing/issues/192"}
| 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:48fe181f-821b-d061-4a16-886c36810f7d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A064:B438C:D0CDFE:110DDFF:6AFFF63A |
| html-safe-nonce | 00e5c0d7032b7f3748329c470661d27b112f9d76064bdd02f56cb6c796aef78d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDY0OkI0MzhDOkQwQ0RGRToxMTBEREZGOjZBRkZGNjNBIiwidmlzaXRvcl9pZCI6IjIwMDc2MzQ2NTI3MzQ0MjA1MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3f9c697a64082a17e97269ed4fa1199d18f46cdc72a89b78a481847a5b374ffa |
| hovercard-subject-tag | issue:143075056 |
| 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/192/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fcdc360e7bec39f1ba76ae23ba61b3313f42ace987035584af54d3fc895827c3/python/typing/issues/192 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fcdc360e7bec39f1ba76ae23ba61b3313f42ace987035584af54d3fc895827c3/python/typing/issues/192 |
| og:image:alt | See http://bugs.python.org/issue26391 . """ A specialized sub-class of a generic type never calls __init__ when it is instantiated. See below for an example: from typing import Generic, TypeVar T =... |
| 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 | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width