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

Importing lru_cache leads to false duplicate-aspect warnings #419

Open
greyblue9 opened this issue Nov 28, 2021 · 2 comments
Open

Importing lru_cache leads to false duplicate-aspect warnings #419

greyblue9 opened this issue Nov 28, 2021 · 2 comments

Comments

@greyblue9
Copy link
Collaborator

Addung the line:
from functools import lru_cache
to src/use/aspectizing.py leads to the following warnings:

src/use/aspectizing.py:66
/data/media/0/src/use/d/src/use/aspectizing.py:66: UserWarning: Applied decorator <function beartype at 0x7ec946aee0> to <function lru_cache at 0x7ede9371f0> multiple times! If you intend this behaviour, use _apply_aspect with force=True
warn(

src/use/aspectizing.py:66
/data/media/0/src/use/d/src/use/aspectizing.py:66: UserWarning: Applied decorator <function decorator_log_calling_function_and_args at 0x7ec8b5c0d0> to <function lru_cache at 0x7ede9371f0> multiple times! If you intend this behaviour, use _apply_aspect with force=True
warn(

@greyblue9
Copy link
Collaborator Author

greyblue9 commented Nov 28, 2021

Note: I think the teason for this might be that we have imported lru_cache in a different file. Howver, it seems that it should not be registering as a duplicate?

Not sure what's exactly happening--I originalky had applied it to get_module_info, but when I removed the actual decorator use and left the import, the warnings stayed

@greyblue9
Copy link
Collaborator Author

Also, I converted the error to a warning for the moment, but feel free to change it back if you want

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

No branches or pull requests

2 participants