Skip to content

Cache values for 'is_available()'#2

Closed
sethmlarson wants to merge 3 commits intomainfrom
cache-is-available
Closed

Cache values for 'is_available()'#2
sethmlarson wants to merge 3 commits intomainfrom
cache-is-available

Conversation

@sethmlarson
Copy link
Copy Markdown
Owner

No description provided.

@sethmlarson
Copy link
Copy Markdown
Owner Author

@mayeut Is this what you were imagining for caching? The runtime doesn't actually speed up any for auditwheel, since the function whichprovides is only called once.



def _available_package_providers(
_is_available_cache: dict[type[PackageProvider], bool] = {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand how caching works here.
Should we expect the default argument to be extended in this case ? (i.e. mutable default)
If that's the case, it should work although a bit hard to read/understand (and is that ok in the context of a no-gil build if called in parallel ?)

@sethmlarson sethmlarson closed this Dec 2, 2025
@sethmlarson sethmlarson deleted the cache-is-available branch December 2, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants