Title: Improve tests of `typing.override` · Issue #102324 · python/cpython · GitHub
Open Graph Title: Improve tests of `typing.override` · Issue #102324 · python/cpython
X Title: Improve tests of `typing.override` · Issue #102324 · python/cpython
Description: Right now we have several things to improve: This branch is not covered by tests: cpython/Lib/typing.py Line 3490 in 4c87537 pass We don't have a single test that ensures that @override will not fail for some weird cases. Since 99.99% of...
Open Graph Description: Right now we have several things to improve: This branch is not covered by tests: cpython/Lib/typing.py Line 3490 in 4c87537 pass We don't have a single test that ensures that @override will not fa...
X Description: Right now we have several things to improve: This branch is not covered by tests: cpython/Lib/typing.py Line 3490 in 4c87537 pass We don't have a single test that ensures that @override will no...
Opengraph URL: https://github.com/python/cpython/issues/102324
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve tests of `typing.override` ","articleBody":"Right now we have several things to improve:\r\n1. This branch is not covered by tests: https://github.com/python/cpython/blob/4c87537efb5fd28b4e4ee9631076ed5953720156/Lib/typing.py#L3490 We don't have a single test that ensures that `@override` will not fail for some weird cases. Since 99.99% of use-cases will simply be `@override def some(...): ...`, it is not very important - but still desirable\r\n2. We don't test `@classmethod`s, I guess it is special enough to be included\r\n3. `@property` is also missing from tests, but is mentioned in PEP: https://peps.python.org/pep-0698/#specification and https://peps.python.org/pep-0698/#limitations-of-setting-override\r\n4. PEP also mentions `@functools.lru_cache` and similar decorators as an example of how wrappers should be nested. Why don't we test it? Right now there are no tests for nested method decorators (except `staticmethod`)\r\n5. It might not hurt to test that parent's methods definitions are not mutated (I think this is a part of the contract)\r\n\r\nPR is on its way :)\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102325\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2023-02-28T13:09:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/102324/cpython/issues/102324"}
| 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:86bc4447-bfed-2134-551e-77513ca31a38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C50:256534:915EE:C5EEA:69695112 |
| html-safe-nonce | 704e6c522dee9c398a62da18b1c6465a1dc00e5882a56647e29757f0ab6083e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzUwOjI1NjUzNDo5MTVFRTpDNUVFQTo2OTY5NTExMiIsInZpc2l0b3JfaWQiOiI0MDYyNjgzODE0MTU0NTU1NjY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 03818069392652c4d1d9fd72c732936c92bcbdfcc5bac11d9c270e4487f8fcd5 |
| hovercard-subject-tag | issue:1603041982 |
| 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/cpython/102324/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7463528d1e994c354d939f10b2300f591c3af859ee3af36fbc64cd5d56e865aa/python/cpython/issues/102324 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7463528d1e994c354d939f10b2300f591c3af859ee3af36fbc64cd5d56e865aa/python/cpython/issues/102324 |
| og:image:alt | Right now we have several things to improve: This branch is not covered by tests: cpython/Lib/typing.py Line 3490 in 4c87537 pass We don't have a single test that ensures that @override will not fa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width