-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Cannot pickle certain type hints with Dill #179
Comments
It's probably because typing does some funky dynamic type generation under the hood, and so pickling by reference isn't enough. I think it should be reasonably easy to fix, as typing is a pure python module, no C involved. I'll have a look when I've a moment, if no one else has. |
Maybe this is another issue where
Note that if you use |
This seems to be a general solution for the primary
Note that typed functions pickle, but lose their annotations:
Looks like
The pattern for a
I didn't check all the objects in So the cases that need some attention appear to be:
|
The
|
cc: @udim FYI |
Also
Hi, I'm trying to pickle some stuff in the
typing
module. I'm curious if there are fundamental limitations here or if this is out of scope for Dill. Note that I filed a similar issue with CloudPickle (cloudpipe/cloudpickle#63). The behavior there is similar though not quite the same. Thanks for your help!This works.
With
List[int]
,dumps
fails as follows.The text was updated successfully, but these errors were encountered: