New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudpickling of class variable fails for subclass of typing.Generic #463
Comments
Also fails if you modify the above to set a property on the parent class:
|
Hi @dannyfriar, thanks for the report. We'll fix this in #448. Also, is: import typing
import cloudpickle
T = typing.TypeVar("T")
class Base(typing.Generic[T]):
foo = "bar"
class Child(Base):
pass a legitimate typing use-case? Regardless of the answer, we'll fix this issue in |
Thanks @pierreglaser. I think this is a legitimate use case (obviously not the dummy example here). A better example from the mypy docs: https://mypy.readthedocs.io/en/stable/generics.html |
@pierreglaser is it possible to merge #448 now? |
Closed by #448 |
Related to: #440
Run the following to create the object and cloudpickle to disk:
Then if load in another Python process:
Gives
AttributeError: 'Child' object has no attribute 'foo'
Using
cloudpickle==2.0.0
and python version3.8.12
. Observed on both Windows 10 and CentOS 8.4.The above example works correctly (i.e. does not throw the
AttributeError
) withcloudpickle==2.0.0
and python version3.6.6
.The text was updated successfully, but these errors were encountered: