We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In a.py:
import cloudpickle from typing import Any, NewType RunDict = NewType("RunDict", dict[str, Any]) with open("tmp.pickle", "wb") as f: f.write(cloudpickle.dumps(RunDict))
In b.py
import cloudpickle with open("tmp.pickle", "rb") as f: value = cloudpickle.load(f) print(value)
λ python3.9 a.py λ python3.9 b.py <function NewType.<locals>.new_type at 0x1004580d0> λ python3.10 a.py λ python3.10 b.py Traceback (most recent call last): File "/Users/shantanu/devoai/openai/b.py", line 3, in <module> value = cloudpickle.load(f) AttributeError: Can't get attribute 'RunDict' on <module '__main__' from '/Users/shantanu/devoai/openai/b.py'>
The text was updated successfully, but these errors were encountered:
Thanks for the report. I confirm I can reproduce with Python 3.11 (I haven't tried Python 3.12).
I suspect we might need something like the _typevar_reduce custom reducer. Feel free to open a PR if you wish.
_typevar_reduce
Sorry, something went wrong.
No branches or pull requests
In a.py:
In b.py
The text was updated successfully, but these errors were encountered: