Giter VIP home page Giter VIP logo

Comments (10)

fgregg avatar fgregg commented on July 18, 2024

I'm running into this right now. There was some work, eight years ago, to have pickle not use python's call stack, but instead use a deque object. This would have allowed for pickling of deeply nested structures. http://bugs.python.org/issue3119

I'm looking to see if anyone has an implementation of this idea, and I'll update this issue if I find one.

from btrees.

fgregg avatar fgregg commented on July 18, 2024

Alternately, it might be possible do take an approach similar to https://github.com/google/pygtrie/blob/master/pygtrie.py#L165-L252 that flattens out the structure in __getstate__ and rehydrates in the __setstate__.

@jamadden, @tseaver would you all consider such an approach. It would be very good for folks like me that want to use BTrees outsize of zope. But, I'm not sure if it would be a meaningful deoptimzation for zope.

If you think it's a possible path, I might start working on a PR.

from btrees.

tseaver avatar tseaver commented on July 18, 2024

@fgregg I would be worried about any "intrusive" change to make pickling outside ZODB work: the machinery is tricky. Perhaps another tree implementation would be a better choice? E.g.: bintrees.

from btrees.

fgregg avatar fgregg commented on July 18, 2024

That makes complete sense, @tseaver. Because I am taking advantage of some of the facilities of zope.index, I might purse a fork of BTrees. If I get something working, we can revisit the question with concrete examples.

from btrees.

jimfulton avatar jimfulton commented on July 18, 2024

I wonder what use cases is motivating this.

from btrees.

fgregg avatar fgregg commented on July 18, 2024

Hi Jim, Here's my use case:
http://dedupe.readthedocs.io/en/latest/Making-smart-comparisons.html#index-blocks

On Fri, Nov 11, 2016 at 8:09 AM Jim Fulton [email protected] wrote:

I wonder what use cases is motivating this.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#44 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAgxbWC-_ZGnAATbZYHk8gV9phBc9ZhYks5q9HcTgaJpZM4JtRZ9
.

from btrees.

jimfulton avatar jimfulton commented on July 18, 2024

There's nothing in the document that indicates to me a need to pickle a BTree.

Is there some implicit assumption that you aren't using ZODB? If so, why dat? :)

from btrees.

fgregg avatar fgregg commented on July 18, 2024

No, I'm not using ZODB, because I've never gotten it to work with my
unusual use case.

On Fri, Nov 11, 2016 at 9:27 AM Jim Fulton [email protected] wrote:

There's nothing in the document that indicates to me a need to pickle a
BTree.

Is there some implicit assumption that you aren't using ZODB? If so, why
dat? :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#44 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAgxbVg7-Dww6Kh5jm3dME-FbCIpXDKqks5q9IlHgaJpZM4JtRZ9
.

from btrees.

jimfulton avatar jimfulton commented on July 18, 2024

That's a bummer. If you feel like mentioning the issues you ran into, maybe on the ZODB list, I'd be interested to see if Ican help.

ZODB (or some of its machinery) seem like a good fit for this use case as they inherently break BTrees up and pickle the parts separately. It's a little hard to say though because I don't know what you're doing with the pickle.

from btrees.

jimfulton avatar jimfulton commented on July 18, 2024

If ZODB isn't involved, it it practical to pickle BTree items?

from btrees.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.