-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
should dump_session accept a list/dict of objects to ignore? #66
Comments
We could replace the objects with a |
It might make sense when there's an isolated object, such as a generator that was created but not used… but in the case that it's a Maybe a better alternate would be |
Yup, I suppose so. What would be the best way to implement that? Overload |
I think either overload the |
I just asked a StackOverflow question that might be a use case for this: |
OK, @mittenchops, question answered. It could be a use case, but remember that if anything on the other end needs your collection, it wouldn't be there. |
Currently when I do a
to remove all objects that will not pickle. There's probably a better way to do it, but I tend to at least do some variant of the above on-the-fly. This will not be the most efficient, but will work as long as |
Firstly, what an epic tool! Super useful when working with jupyter notebooks that take a long time to complete and recomputing everything is either a) impossible b) merely a massive pain - thank you for making it! I think it would be great if this ^ above hack were incorporated into the package itself, i.e.
Produces
The user types yes to continue and dill saves everything about the current environment that it can, ignoring the variables specified. In a large file with a lot of globals I imagine that even running the check might take a while (it does in some of my files) so there should probably be an additional flag so that the user can set whether they want dill to automatically pickle even if it can't do everything - default being yes (if the user selects no, then, if dill can't pickle everything like above, they will be prompted asking whether they want to continue). It would be a big quality of life improvement for me, and since I'm hardly unique I'm guessing many others. Going hunting online for a work around isn't easy (this post, presenting the best solution, is quite hidden away and I'm guessing many don't read through it / miss it). ###################################################### P.S: Until such a time: @mmckerns fix needs a tiny bit of updating. iteritems is deprecated in Python3. Also, map is lazy, and thus doesn't actually do anything. An easy way to force execution is to turn it into a list. In all:
|
Hello, I'm working on a new feature like this for Before I submit a draft PR, how do you think the API could be like? And how should I already have a working prototype that can deal with IPython's command history variables. 👌🏼 |
I'm not sure what kind of impact that might have if one would ignore an object... then expect to start up a session again and everything work. Maybe it's not up to
dill
to care… and it's the user's problem if it blows things up in the dump/load of the session.The text was updated successfully, but these errors were encountered: