Comments (5)
I agree that that sort of functionality is a decent fit for cacheutils, and I have done a few specific implementations of the pattern so looking at a bolton makes sense. That said, I don't think there's anything in particular already in cacheutils that would enable it, so it's not the lowest-hanging fruit.
Is there something specific that you'd like to see in a new cached property API/implementation?
Thanks for bringing it up though, this is definitely something that comes up regularly!
from boltons.
Thanks for the feedback. The way I cache properties is dead simple, stupid. So I have no particular requirement.
As you said it's quite a common pattern. Just implement a minimal working cached properties based on your needs. We'll iterate from there depending on real use-cases.
from boltons.
Hey @kdeldycke thanks for your patience. Have a look at the new cachedproperty. It takes the standard approach I've used in a couple of projects. There may be some niceties worth adding, but this one is the one that works for me!
from boltons.
The new cachedproperty()
is nice! That's exactly what I was looking for. I'll try it in the next couple of days. Let's close the issue for now. I'll re-open this one or a new one if I stumble upon any issue.
Thanks @mahmoud ! :)
from boltons.
Great! Planning to do a release this week.
from boltons.
Related Issues (20)
- 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
- 23.1.1: pytest (8.1.0) fail HOT 3
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.