Title: `cls` in classmethods of derived classes always refers to the parent class (rather than the derived one) · Issue #120 · microsoft/python-language-server · GitHub
Open Graph Title: `cls` in classmethods of derived classes always refers to the parent class (rather than the derived one) · Issue #120 · microsoft/python-language-server
X Title: `cls` in classmethods of derived classes always refers to the parent class (rather than the derived one) · Issue #120 · microsoft/python-language-server
Description: Easier to explain with an example: class Foo: @classmethod def get_an_instance(cls): return cls() class Bar(Foo): pass my_bar = Bar.get_an_instance() In VSCode w/ Python plugin 2018.8.0, my_bar is typed as a Foo, while I'd expect it to b...
Open Graph Description: Easier to explain with an example: class Foo: @classmethod def get_an_instance(cls): return cls() class Bar(Foo): pass my_bar = Bar.get_an_instance() In VSCode w/ Python plugin 2018.8.0, my_bar is ...
X Description: Easier to explain with an example: class Foo: @classmethod def get_an_instance(cls): return cls() class Bar(Foo): pass my_bar = Bar.get_an_instance() In VSCode w/ Python plugin 2018.8.0, my_bar is ...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/120
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`cls` in classmethods of derived classes always refers to the parent class (rather than the derived one)","articleBody":"Easier to explain with an example:\r\n\r\n```python\r\nclass Foo:\r\n @classmethod\r\n def get_an_instance(cls):\r\n return cls()\r\n\r\nclass Bar(Foo):\r\n pass\r\n\r\nmy_bar = Bar.get_an_instance()\r\n```\r\n\r\nIn VSCode w/ Python plugin 2018.8.0, `my_bar` is typed as a `Foo`, while I'd expect it to be typed as a `Bar`.","author":{"url":"https://github.com/davidwallacejackson","@type":"Person","name":"davidwallacejackson"},"datePublished":"2018-09-21T00:10:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/120/python-language-server/issues/120"}
| 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:4a2c0274-d4ad-75dd-4614-240aa42b6ef1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D878:CB81E:2592465:3380CAE:6A503E2B |
| html-safe-nonce | 7d0dc2ad46d21c3f459b220d7fa534170a9942f599e79332185f2864e2ced6eb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODc4OkNCODFFOjI1OTI0NjU6MzM4MENBRTo2QTUwM0UyQiIsInZpc2l0b3JfaWQiOiIyMzAxNTkwODQ3MzQ1NDA5NTc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c69f7f8500ff40dc9774a34ff7b2bdc96e6be400d19aff37bba88c642b639ab4 |
| hovercard-subject-tag | issue:362411985 |
| 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/microsoft/python-language-server/120/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d68b892ff18085a0ee9013a2d276ee4b195df2ce6033c0ed45845a5748623d9/microsoft/python-language-server/issues/120 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d68b892ff18085a0ee9013a2d276ee4b195df2ce6033c0ed45845a5748623d9/microsoft/python-language-server/issues/120 |
| og:image:alt | Easier to explain with an example: class Foo: @classmethod def get_an_instance(cls): return cls() class Bar(Foo): pass my_bar = Bar.get_an_instance() In VSCode w/ Python plugin 2018.8.0, my_bar is ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidwallacejackson |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| 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 | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width