Comments (10)
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.
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.
@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.
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.
I wonder what use cases is motivating this.
from btrees.
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.
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.
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.
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.
If ZODB isn't involved, it it practical to pickle BTree items?
from btrees.
Related Issues (20)
- Release 4.7.3 HOT 2
- Pylance has problem resolving imports HOT 5
- Add support to release aarch64 wheels HOT 2
- Python 2: OxBTrees allow types as keys; Python 3 does not
- Can we move to the src/ layout? HOT 3
- Support PURE_PYTHON=0 to require C extensions
- BTree.get() swallows POSKeyError on internal corruption (C only) HOT 2
- Python/C Inconsistency: Detecting classes that just implement `__eq__`
- Python/C Inconsistency: Getting/Setting max_internal_size on the BTree class
- Regression in 4.9: Subclasses can't use @adapter
- fsBTree and fsTreeSet broken in 4.9.0/4.9.1
- fsBTree.difference fails when the second argument is a set HOT 2
- Zope5.2.1 install warnings HOT 3
- Convert to meta/config HOT 2
- Consider using cibuldwheel for building binary wheels. HOT 1
- 4.10.0: sphinx warnings `reference target not found` HOT 3
- 4.10.0: pytest is failing in some units HOT 6
- btrees not installing on m1 computer HOT 2
- Get a random element from a BTree HOT 2
- 'IFBucket' object has no attribute 'byValue' when running with PURE_PYTHON HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btrees.