Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use EAFP approach in local.py #463

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sevdog
Copy link

@sevdog sevdog commented May 24, 2024

This aims first of all to align the code of _CVar.__delattr__ with that of _Cvar.__getattr__.

Then to use the EAFP approach in Local._lock_storage, to improve efficiency since the hasattr method is implemented by catching the AttributeError of a getattr call.

I know that this should save just a couple of CPU cycle, but I belive it is worth it.

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.

1 participant