classification
Title: pickle uses getattr(obj, '__reduce__') instead of getattr(type(obj), '__reduce__')
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: pickle special methods are looked up on the instance rather than the type
View: 16251
Assigned To: Nosy List: bup, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-06-19 13:49 by bup, last changed 2017-06-20 18:09 by serhiy.storchaka. This issue is now closed.

Messages (2)
msg296337 - (view) Author: Dan Snider (bup) * Date: 2017-06-19 13:49
That is inconsistent with every other object.__dunder_method__ which still work even if the instance gets an attribute with the same name.
msg296476 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-06-20 18:09
This is a duplicate of issue16251.
History
Date User Action Args
2017-06-20 18:09:37serhiy.storchakasetstatus: open -> closed

superseder: pickle special methods are looked up on the instance rather than the type

nosy: + serhiy.storchaka
messages: + msg296476
resolution: duplicate
stage: resolved
2017-06-19 13:49:40bupcreate