GithubHelp home page GithubHelp logo

Cached property about boltons HOT 5 CLOSED

mahmoud avatar mahmoud commented on May 21, 2024
Cached property

from boltons.

Comments (5)

mahmoud avatar mahmoud commented on May 21, 2024

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.

kdeldycke avatar kdeldycke commented on May 21, 2024

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.

mahmoud avatar mahmoud commented on May 21, 2024

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.

kdeldycke avatar kdeldycke commented on May 21, 2024

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.

mahmoud avatar mahmoud commented on May 21, 2024

Great! Planning to do a release this week.

from boltons.

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.