Subclass object of pathlib.Path gets custom attributes lost after pickle.load
from pathlib import Path import pickle class P(type(Path())): def __init__(self, *args): super().__init__() self.a = ” p = P() p.a = ‘x’ with open(‘xx’, ‘wb’) as wf: pickle….