[issue47034] pickle not working correctly when custom field is directly initialized by constructors

2022-03-16 Thread jeffersonqin
jeffersonqin <1247006...@qq.com> added the comment: Thanks! This fully answers my question. Sorry, but I've got another question regards to your answer. It is that when I deal with other fields in class Parent similar to child, with the only difference is that their types are bu

[issue47034] pickle not working correctly when custom field is directly initialized by constructors

2022-03-16 Thread jeffersonqin
New submission from jeffersonqin <1247006...@qq.com>: For the following code piece: ``` import pickle class Child: def __init__(self, field): self.field = field class Parent: child = Child(0.5) if __name__ == '__main__': i = input()