Title: Improve test cases for type substitution of a list of types after initial ParamSpec substitution · Issue #103054 · python/cpython · GitHub
Open Graph Title: Improve test cases for type substitution of a list of types after initial ParamSpec substitution · Issue #103054 · python/cpython
X Title: Improve test cases for type substitution of a list of types after initial ParamSpec substitution · Issue #103054 · python/cpython
Description: After merging #102808 I realized that I've missed several important cases. Right now substitution algorithm has these lines: cpython/Lib/typing.py Lines 1477 to 1488 in 2cdc518 if self.__origin__ == collections.abc.Callable and isinstanc...
Open Graph Description: After merging #102808 I realized that I've missed several important cases. Right now substitution algorithm has these lines: cpython/Lib/typing.py Lines 1477 to 1488 in 2cdc518 if self.__origin__ =...
X Description: After merging #102808 I realized that I've missed several important cases. Right now substitution algorithm has these lines: cpython/Lib/typing.py Lines 1477 to 1488 in 2cdc518 if self.__origin...
Opengraph URL: https://github.com/python/cpython/issues/103054
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve test cases for type substitution of a list of types after initial ParamSpec substitution","articleBody":"After merging https://github.com/python/cpython/pull/102808 I realized that I've missed several important cases.\r\n\r\nRight now substitution algorithm has these lines: https://github.com/python/cpython/blob/2cdc5189a6bc3157fddd814662bde99ecfd77529/Lib/typing.py#L1477-L1488\r\n\r\nIt is tested. But, it is never tested for the nested arguments:\r\n\r\nhttps://github.com/python/cpython/blob/2cdc5189a6bc3157fddd814662bde99ecfd77529/Lib/typing.py#L1500-L1511\r\n\r\nI think that `Callable` is complex and important enought to be covered with as many cases as possible. Furthermore, `Callable` can be nested deeply in real types and we need to be sure that this use-case works as intended.\r\n\r\nI will send a PR with more tests :)\r\n\r\nRelated https://github.com/python/cpython/issues/88965\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103055\n* gh-103105\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2023-03-27T08:12:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/103054/cpython/issues/103054"}
| 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:f385bf59-20c1-97a2-8336-3f34542d9240 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC26:8D11F:4A84D0:6796DE:696A6C59 |
| html-safe-nonce | afd64f03140d2432813feb17f677308203b24e27d1768a6af4a1ad9172ed521d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzI2OjhEMTFGOjRBODREMDo2Nzk2REU6Njk2QTZDNTkiLCJ2aXNpdG9yX2lkIjoiNTkyOTAyODMyNjExNjcxNTYwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56d9aa98f7cb73d1037110eb4da78e233e6b54e201c2339b947655dd5cd35b19 |
| hovercard-subject-tag | issue:1641615141 |
| 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/103054/issue_layout |
| twitter:image | https://opengraph.githubassets.com/593b4d59ef934f349b5f30bc848620aac51884ca3c64f85bfe56d777c28f5260/python/cpython/issues/103054 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/593b4d59ef934f349b5f30bc848620aac51884ca3c64f85bfe56d777c28f5260/python/cpython/issues/103054 |
| og:image:alt | After merging #102808 I realized that I've missed several important cases. Right now substitution algorithm has these lines: cpython/Lib/typing.py Lines 1477 to 1488 in 2cdc518 if self.__origin__ =... |
| 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 | 6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6 |
| 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 | f2d9f6432a5a115ec709295ae70623f33bb80aee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width