Title: gh-91896: Improve visibility of `ByteString` deprecation warnings by AlexWaygood · Pull Request #104294 · python/cpython · GitHub
Open Graph Title: gh-91896: Improve visibility of `ByteString` deprecation warnings by AlexWaygood · Pull Request #104294 · python/cpython
X Title: gh-91896: Improve visibility of `ByteString` deprecation warnings by AlexWaygood · Pull Request #104294 · python/cpython
Description: #102096 added deprecation warnings for collections.abc.ByteString, but these warnings are currently only emitted on subclassing ByteString or calling isinstance() against it. Importing ByteString or accessing it via import collections.abc; collections.abc.ByteString does not currently trigger any warnings, meaning somebody who's just using the class for type annotations might not get any warning that the class will be removed in 3.14. Moreover, the isinstance() deprecation warnings are only emitted on isinstance() checks against collections.abc.ByteString, not on isinstance() checks against typing.ByteString. The docs update that we just made in 1f56795 says that typing.ByteString will also be removed in Python 3.14, so we should emit the same deprecation warnings for typing.ByteString. This PR adds deprecation warnings for: from collections.abc import ByteString import collections.abc; collections.abc.ByteString from typing import ByteString import typing; typing.ByteString isinstance(b"", typing.ByteString) Issue: gh-91896
Open Graph Description: #102096 added deprecation warnings for collections.abc.ByteString, but these warnings are currently only emitted on subclassing ByteString or calling isinstance() against it. Importing ByteString o...
X Description: #102096 added deprecation warnings for collections.abc.ByteString, but these warnings are currently only emitted on subclassing ByteString or calling isinstance() against it. Importing ByteString o...
Opengraph URL: https://github.com/python/cpython/pull/104294
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:6ece78ed-2ee8-6634-8118-7914eb7d0f3c |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 844C:1AB621:48A68B:6229E9:6969DE7F |
| html-safe-nonce | 15f42856089d7c0728ac7b8ea57166239b519a2f58dbcc024abb4b39941bbdd9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDRDOjFBQjYyMTo0OEE2OEI6NjIyOUU5OjY5NjlERTdGIiwidmlzaXRvcl9pZCI6Ijg2NjM0OTE3MzI2ODgxOTkyOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ba10c18f42187244caee413ed3c0b69717d5c26f54ffa3a9022d47097b711714 |
| hovercard-subject-tag | pull_request:1342389061 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/cpython/pull/104294/checks |
| twitter:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| og:image:alt | #102096 added deprecation warnings for collections.abc.ByteString, but these warnings are currently only emitted on subclassing ByteString or calling isinstance() against it. Importing ByteString o... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width