barneygale / pathlib-abc

Python base classes for rich path objects
Other
26 stars 1 forks source link

`functools.cache()` is only available in Python 3.9+ #9

Closed barneygale closed 9 months ago

barneygale commented 9 months ago

There's one instance of functools.cache() in the upstream pathlib._abc package. This must be replaced for compatibility with Python 3.8 in this package.

AlexWaygood commented 9 months ago

Hmm, can't you just use functools.lru_cache(maxsize=None) on Python <3.9?

AlexWaygood commented 9 months ago

Oh, I think I see -- you want the code in this package to match the upstream CPython code exactly, so that it's easy to keep the backport in sync with the CPython main branch? So you'd have to change CPython pathlib so that it used lru_cache(maxsize=None)? Fair enough!

barneygale commented 9 months ago

Yeah, that's the idea. I'm not expecting it to match exactly as there will be import differences for example, but I'd like to keep the differences to a minimum.