Giter VIP home page Giter VIP logo

Comments (3)

vergeev avatar vergeev commented on May 27, 2024

I started looking into the issue and wanted to clarify a couple of things.

  1. Does this issue mean rez will drop Python 3.7 compatibility? functools.cached_property was added in Python 3.8 (docs, StackOverflow). As an alternative, some sort of compatibility layer can be introduced (e.g., use the replacement starting with Python 3.8, and leave the previous implementation for Python 3.7). What is a preferred solution here?

  2. Do we need to be concerned about uncache? functools.cached_property uncaches a property the same way, by deleting the attribute (docs):

    The cached value can be cleared by deleting the attribute. This allows the cached_property method to run again.

    So my intuition is that whenever uncache is called in current solution, it can be reimplemented in the replacement, too.

from rez.

JeanChristopheMorinPerso avatar JeanChristopheMorinPerso commented on May 27, 2024
  1. Does this issue mean rez will drop Python 3.7 compatibility? functools.cached_property was added in Python 3.8 (docs, StackOverflow). As an alternative, some sort of compatibility layer can be introduced (e.g., use the replacement starting with Python 3.8, and leave the previous implementation for Python 3.7). What is a preferred solution here?

We could potentially depend on https://pypi.org/project/backports.cached-property/ for Python 3.7.

  1. Do we need to be concerned about uncache? functools.cached_property uncaches a property the same way, by deleting the attribute (docs):

From what I see, uncached is used in two different places (see https://github.com/search?q=repo%3AAcademySoftwareFoundation%2Frez+%2F%5B%5E_+%5Duncache%5C%28%2F&type=code). If we can delete the attribute to uncache, then I guess we could try to use the built-in cached_property.

One thing I'm very concerned about is the speed. cached_property is used in hot paths. I see a lot more attribute accesses in functools.cached_property than in our version.

from rez.

JeanChristopheMorinPerso avatar JeanChristopheMorinPerso commented on May 27, 2024

Thinking about it a little bit more, maybe we don't need to get rid of our implementation. I'd be interested to see if it can provide any speed improvements though.

from rez.

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.