Comments (3)
#114 is merged and a release is forthcoming. Thank you both for the report and the great fixes!
from boltons.
I can see two potential solutions to this @doroncohen:
The first is to make the resulting dictionary contain string instances of _DeferredLine. After all, the docstring for to_dict
says "Get a :class:dict
copy of the Callpoint. Useful for serialization."
This would effectively change the API though; I'm not sure what @mahmoud feels in regards to API stability here. There is always a slim chance this could break things for someone who is using to_dict in an unconventional or unexpected way.
This leaves another option: Provide a to_json
method for all Callpoint object instances. This would result in a stable API and JSON serialization support. Potentially handy.
I actually lean towards the first solution personally because it seems weird to have a class designed for serialization that can't actually be easily serialized.
To that end I've created two pull requests, each implementing one version of the fix.
and
Really I'm not in a position to make the call here, but I figured it was easy enough to provide both potential solutions and let the boltons maintainers make a call.
from boltons.
Yeah, I'm probably the most extensive user of this API, but having gone through all my uses, they all stringify the DeferredLine, so not only won't the first solution break my code, but it probably should have been built-in to begin with. I'm going to do some more testing before release, but for now I think I'm going to go with #114.
from boltons.
Related Issues (20)
- attrs/dataclasses-style decorator helper
- Mfnvhudhvsdmbc HOT 1
- Test failure with Python 3.11 HOT 1
- Tag for the 23.0.0 release is missing HOT 1
- Include tests in future pypi sdist tarball HOT 5
- Convert list of dict items to list of string items
- `ParsedException.from_string(text).to_string() == text` property violated due to anchors
- `boltons.ecoutils` `23.0.0` breaks `pdb` interactive prompt in `pytest` debug sessions HOT 4
- Non-empty `dictutils.OMD` cannot be loaded from `pickle` HOT 1
- RFC: Make boltons Python 3.7+ only. HOT 8
- Support in-place union for `dictutils.OrderedMultiDict` HOT 1
- [Feature request] Parametrize the delimiter to make glom use any kind of Path delimiter, not just `.` HOT 1
- wraps loses keywords
- chunked filter HOT 3
- tracking some ideas HOT 3
- LRU .values() and dict return old entries HOT 3
- call _orig_default identity
- Names in `boltons.strutils.__all__` with no definitions
- Missing git tags for 23.1.0 & 23.1.1 releases HOT 1
- iterutils.get_path has undocumented path as string parameter 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 boltons.