[issue37489] pickling instance which inherited from Exception with keyword only parameter

2022-01-06 Thread Irit Katriel
Irit Katriel added the comment: > I want to known [...] how to implement the logic in code 2 (passing keyword > only parameter to __new__/__init__ when pickling for class inherted from > Exception) This is currently a problem, see issue27015. -- resolution: -> duplicate stage:

[issue37489] pickling instance which inherited from Exception with keyword only parameter

2022-01-06 Thread Irit Katriel
Irit Katriel added the comment: > I want to known why it is It's because Exception implements __reduce__ and that takes precedence over __getnewargs_ex__. You can see that with this example: import pickle class MyException(): def __init__(self, desc, item):

[issue37489] pickling instance which inherited from Exception with keyword only parameter

2019-07-08 Thread liyang
liyang added the comment: yesterday i have test two case, first i find the code 1 not execute the __init__ when execute loads. second the code 1 and code 2 dumps result s is not equal,because the dumps is the buildin function ,so i can't find more message.but if the code2 only have keyword

[issue37489] pickling instance which inherited from Exception with keyword only parameter

2019-07-03 Thread liugang
Change by liugang : -- nosy: +alexandre.vassalotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37489] pickling instance which inherited from Exception with keyword only parameter

2019-07-03 Thread SilentGhost
Change by SilentGhost : -- nosy: +pitrou versions: +Python 3.7 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37489] pickling instance which inherited from Exception with keyword only parameter

2019-07-02 Thread liugang
New submission from liugang : -- code 1 import pickle class MyException(): def __init__(self, desc, *, item): super().__init__() self.desc = desc self.item = item def __getnewargs_ex__(self): print('called in