Title: Loosen some types to avoid pain in real-life situations by ilevkivskyi · Pull Request #4870 · python/typeshed · GitHub
Open Graph Title: Loosen some types to avoid pain in real-life situations by ilevkivskyi · Pull Request #4870 · python/typeshed
X Title: Loosen some types to avoid pain in real-life situations by ilevkivskyi · Pull Request #4870 · python/typeshed
Description: In this diff: Loosen set.__[i]sub__() to allow typical use cases (that work at runtime). Namely, allow removing unicode from a set of str, and allow removing optional values from non-optional sets. Avoid using union return types in cryptography deserialization functions. Tune SupportsItems so that dict implements it on Python 2. About the first item, I think mypy should support the overloads on generic self-types (see https://mypy.readthedocs.io/en/stable/more_types.html#restricted-methods-in-generic-classes), but I am not sure about other type-checkers. cc @JukkaL
Open Graph Description: In this diff: Loosen set.__[i]sub__() to allow typical use cases (that work at runtime). Namely, allow removing unicode from a set of str, and allow removing optional values from non-optional sets...
X Description: In this diff: Loosen set.__[i]sub__() to allow typical use cases (that work at runtime). Namely, allow removing unicode from a set of str, and allow removing optional values from non-optional sets...
Opengraph URL: https://github.com/python/typeshed/pull/4870
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files/:range(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a1245c7a-8c46-9808-163c-efafaa0e3d6c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BC6A:17A025:3695672:4899840:6A6558AB |
| html-safe-nonce | 914952ca09d27066de176703fcc9eb874e79a273fea8ca390e2d12f5015f0881 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzZBOjE3QTAyNTozNjk1NjcyOjQ4OTk4NDA6NkE2NTU4QUIiLCJ2aXNpdG9yX2lkIjoiNzMzNjk3MTUzMTUyOTMyMDExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b8e268a97d5197da72b1889f3a64a892ac7441980cae719bbea680d04cda74a1 |
| hovercard-subject-tag | pull_request:546556822 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/typeshed/pull/4870/files/1864edcf6da31c1e023f1fb556e0b47671299a69 |
| twitter:image | https://avatars.githubusercontent.com/u/12005495?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12005495?s=400&v=4 |
| og:image:alt | In this diff: Loosen set.__[i]sub__() to allow typical use cases (that work at runtime). Namely, allow removing unicode from a set of str, and allow removing optional values from non-optional sets... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width