Issue 20823: [doc] Clarify copyreg.pickle() documentation (original) (raw)
Issue20823
Created on 2014-03-02 08:46 by peter.otten, last changed 2022-04-11 14:57 by admin.
Files | |||
---|---|---|---|
File name | Uploaded | Description | Edit |
copyreg.patch | peter.otten,2014-03-02 08:53 | review |
Pull Requests | |||
---|---|---|---|
URL | Status | Linked | Edit |
PR 30230 | merged | kumaraditya,2021-12-22 12:08 | |
PR 30669 | merged | miss-islington,2022-01-18 19:53 | |
PR 30670 | merged | miss-islington,2022-01-18 19:53 |
Messages (6) | ||
---|---|---|
msg212541 - (view) | Author: Peter Otten (peter.otten) * | Date: 2014-03-02 08:46 |
The documentation for copyreg.pickle(type, function, constructor=None) has the sentence "TypeError will be raised if *object* is a class or *constructor* is not callable." It's not clear to me what "object" refers to. I believe it refers to the first arg (called ob_type in 2.x) and classic classes which were handled with def pickle(ob_type, pickle_function, constructor_ob=None): if type(ob_type) is _ClassType: raise TypeError("copy_reg is not intended for use with classes") in 2.x If I'm right the above sentence should become. "A TypeError will be raised if *constructor* is not callable." in 3.x. If I'm wrong please think of way to express the intended meaning more clearly. Another minor change: class C need not inherit from object explicitly in 3.x. | ||
msg288092 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-02-18 21:09 |
The phrase "*function* should return either a string or a tuple containing two or three elements." de-facto is outdated too. Since Python 2.3 a tuple returned by the function must have two to five elements. copyreg.constructor() no longer does anything useful, and the constructor parameter of copyreg.pickle() is virtually ignored. | ||
msg296271 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-06-18 12:45 |
Could you update your patch Peter, and since CPython development is moved to GitHub, create a pull request? | ||
msg410883 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2022-01-18 19:53 |
New changeset 65940fa5c12a4b4a0650c7845044ffd63b94e227 by Kumar Aditya in branch 'main': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/65940fa5c12a4b4a0650c7845044ffd63b94e227 | ||
msg410884 - (view) | Author: miss-islington (miss-islington) | Date: 2022-01-18 20:17 |
New changeset 9238a52cbc39c17ca6c7a8cbda32808dd5522a59 by Miss Islington (bot) in branch '3.10': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/9238a52cbc39c17ca6c7a8cbda32808dd5522a59 | ||
msg410885 - (view) | Author: miss-islington (miss-islington) | Date: 2022-01-18 20:17 |
New changeset 8527f7a722aee3d9025267cc7ff2eb8afa38d166 by Miss Islington (bot) in branch '3.9': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/8527f7a722aee3d9025267cc7ff2eb8afa38d166 |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:57:59 | admin | set | github: 65022 |
2022-01-18 20:17:10 | miss-islington | set | messages: + |
2022-01-18 20:17:03 | miss-islington | set | messages: + |
2022-01-18 19:53:57 | miss-islington | set | pull_requests: + <pull%5Frequest28870> |
2022-01-18 19:53:52 | miss-islington | set | nosy: + miss-islingtonpull_requests: + <pull%5Frequest28869> |
2022-01-18 19:53:52 | serhiy.storchaka | set | messages: + |
2021-12-22 12:08:45 | kumaraditya | set | keywords: + patchnosy: + kumaradityapull_requests: + <pull%5Frequest28452> |
2021-12-09 23:26:15 | iritkatriel | set | keywords: + easy, - patchtitle: Clarify copyreg.pickle() documentation -> [doc] Clarify copyreg.pickle() documentationversions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.5, Python 3.6, Python 3.7 |
2017-06-18 12:45:07 | serhiy.storchaka | set | messages: + |
2017-02-18 21:09:56 | serhiy.storchaka | set | versions: + Python 3.5, Python 3.6, Python 3.7, - Python 3.3nosy: + serhiy.storchakamessages: + type: behaviorstage: patch review |
2014-03-02 08:53:02 | peter.otten | set | files: + copyreg.patchkeywords: + patch |
2014-03-02 08:46:06 | peter.otten | create |