Skip to content
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

correct failures, registered, and succeeds #519

Merged
merged 3 commits into from
Jun 26, 2022
Merged

correct failures, registered, and succeeds #519

merged 3 commits into from
Jun 26, 2022

Conversation

mmckerns
Copy link
Member

  1. move failing types from succeeds to failures, and succeeding types from failures to succeeds
  2. update registered so matches reverse_typemap not in (builtins and types)

fixes: #518

@mmckerns mmckerns added this to the dill-0.3.6 milestone Jun 25, 2022
@mmckerns
Copy link
Member Author

After the above commits...

>>> import dill
>>> from dill._objects import failures, registered, succeeds
>>> import warnings
>>> warnings.filterwarnings('ignore')
>>> def check(d, ok=True):
...   res = []
...   for k,v in d.items():
...     try:
...       z = dill.copy(v)
...       if ok: res.append(k)
...     except:
...       if not ok: res.append(k)
...   return res
... 
>>> check(failures)
[]
>>> check(registered, ok=False) # should be empty
['SymtableEntryType']
>>> check(succeeds, ok=False) # should be empty
['SymtableEntryType']
>>> 
>>> import builtins
>>> import types
>>> q = dill._dill._reverse_typemap
>>> p = {k:v for k,v in q.items() if k not in vars(builtins) and k not in vars(types)}
>>> set(p.keys()).difference(registered.keys())
set()
>>> set(registered.keys()).difference(p.keys())
set()
>>> 

Behavior is as expected, with the exception of SymtableEntryType -- which is not serializable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix object classification in _objects
1 participant