Title: Pickling deque subclasses ignores their `__dict__`. · Issue #4769 · RustPython/RustPython · GitHub
Open Graph Title: Pickling deque subclasses ignores their `__dict__`. · Issue #4769 · RustPython/RustPython
X Title: Pickling deque subclasses ignores their `__dict__`. · Issue #4769 · RustPython/RustPython
Description: Caught after updating test_deque.py. In RustPython, pickling a deque subclass ignores its __dict__: >>>>> import pickle >>>>> from collections import deque >>>>> class Deque(deque): pass >>>>> d = Deque() >>>>> d.x = "value" >>>>> e = pi...
Open Graph Description: Caught after updating test_deque.py. In RustPython, pickling a deque subclass ignores its __dict__: >>>>> import pickle >>>>> from collections import deque >>>>> class Deque(deque): pass >>>>> d = ...
X Description: Caught after updating test_deque.py. In RustPython, pickling a deque subclass ignores its __dict__: >>>>> import pickle >>>>> from collections import deque >>>...
Opengraph URL: https://github.com/RustPython/RustPython/issues/4769
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pickling deque subclasses ignores their `__dict__`.","articleBody":"Caught after updating `test_deque.py`. In RustPython, pickling a deque subclass ignores its `__dict__`:\r\n\r\n```python\r\n>>>>> import pickle\r\n>>>>> from collections import deque\r\n>>>>> class Deque(deque): pass\r\n>>>>> d = Deque()\r\n>>>>> d.x = \"value\"\r\n>>>>> e = pickle.loads(pickle.dumps(pickle.HIGHEST_PROTOCOL))\r\n>>>>> e.__dict__\r\n{}\r\n```\r\n\r\nWhile in Python, `__dict__` is correctly returned as `{'x': 'value'}`.\r\n\r\nThis doesn't appear to be the case with some other collections like `list` and `dict` so those could probably serve as an inspiration for what might be missing in `deque`.\r\n\r\nFor testing purposes, see [`test_copy_pickle`](https://github.com/RustPython/RustPython/blob/25ca331dc81e617498465ecdb2f848ec81025f71/Lib/test/test_deque.py#L818) in `Lib/test/test_deque.py`.","author":{"url":"https://github.com/DimitrisJim","@type":"Person","name":"DimitrisJim"},"datePublished":"2023-03-25T13:37:33Z","url":"https://github.com/RustPython/RustPython/issues/4769"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:892c3c5a-abec-8837-09b4-31329a5bdce9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDD0:2714DE:23C919A:3076AD5:6B00271B |
| html-safe-nonce | 4620b7178974051f718ebecba0063144ddd59e91b2863c7bcee2824b4b2c0ab8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREQwOjI3MTRERToyM0M5MTlBOjMwNzZBRDU6NkIwMDI3MUIiLCJ2aXNpdG9yX2lkIjoiNDkzMDI2OTgwMjEzMzQ2NDg1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a9c5574840a28e82f3b4c1be8b960d0b337da63feaf354ef7005b973e53d79d |
| hovercard-subject-tag | issue:1640521755 |
| 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/RustPython/RustPython/4769/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0664a521b6fd27c3157ab0ace2406cc228ae2f5dfd504d76d0157db2c2bc2048/RustPython/RustPython/issues/4769 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0664a521b6fd27c3157ab0ace2406cc228ae2f5dfd504d76d0157db2c2bc2048/RustPython/RustPython/issues/4769 |
| og:image:alt | Caught after updating test_deque.py. In RustPython, pickling a deque subclass ignores its __dict__: >>>>> import pickle >>>>> from collections import deque >>>>> class Deque(deque): pass >>>>> d = ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DimitrisJim |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width