Title: [3.7] bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216) by miss-islington · Pull Request #6264 · python/cpython · GitHub
Open Graph Title: [3.7] bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216) by miss-islington · Pull Request #6264 · python/cpython
X Title: [3.7] bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216) by miss-islington · Pull Request #6264 · python/cpython
Description: This also fixes python/typingGH-512 This also fixes python/typingGH-511 As was discussed in both issues, some typing forms deserve to be treated as immutable by copy and pickle modules, so that: copy(X) is X deepcopy(X) is X loads(dumps(X)) is X GH- pickled by reference This PR adds such behaviour to: Type variables Special forms like Union, Any, ClassVar Unsubscripted generic aliases to containers like List, Mapping, Iterable This not only resolves inconsistencies mentioned in the issues, but also improves backwards compatibility with previous versions of Python (including 3.6). Note that this requires some dances with module for type variables (similar to NamedTuple) because the class TypeVar itself is define in typing, while type variables should get module where they were defined. https://bugs.python.org/issue32873 (cherry picked from commit 8349403) Co-authored-by: Ivan Levkivskyi levkivskyi@gmail.com https://bugs.python.org/issue32873
Open Graph Description: This also fixes python/typingGH-512 This also fixes python/typingGH-511 As was discussed in both issues, some typing forms deserve to be treated as immutable by copy and pickle modules, so that: c...
X Description: This also fixes python/typingGH-512 This also fixes python/typingGH-511 As was discussed in both issues, some typing forms deserve to be treated as immutable by copy and pickle modules, so that: c...
Opengraph URL: https://github.com/python/cpython/pull/6264
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4d10b2d6-2c10-fd97-c45d-f566ef960ff3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 878E:35C55B:330928:456258:6A4D9DB7 |
| html-safe-nonce | 878fbc695b5e232f08d966892f8b217679b75820c08ab4b2a2983a183fe2a8f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzhFOjM1QzU1QjozMzA5Mjg6NDU2MjU4OjZBNEQ5REI3IiwidmlzaXRvcl9pZCI6IjYzMTkyMTk4MDg1NTExNDg5ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 12862559ceb7fabd9c0557b15390e8b75912e73b6f55d181f9176583cedec6c8 |
| hovercard-subject-tag | pull_request:177580236 |
| 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/cpython/pull/6264/files |
| twitter:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| og:image:alt | This also fixes python/typingGH-512 This also fixes python/typingGH-511 As was discussed in both issues, some typing forms deserve to be treated as immutable by copy and pickle modules, so that: c... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7f13faa65cccc9b729d674da83335d5dcfdfd193 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width