Example
import cloudpickle
import pydantic
class Bar(pydantic.BaseModel):
pass
if __name__ == '__main__':
cloudpickle.loads(cloudpickle.dumps(Bar()))
Technical Background
The issue is the interaction between:
https://github.com/samuelcolvin/pydantic/blob/de0657e4a5495de9378db9fe15a17334c2b0fae5/pydantic/main.py#L865-L868
and:
|
is_litteral = getattr(obj, '__values__', None) is not None |
Refs
This was originally discussed in #393.