-
Notifications
You must be signed in to change notification settings - Fork 166
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
refactor: Use cached_property to cache the show_debug2 #232
Conversation
d53bfbc
to
3e90f30
Compare
3e90f30
to
f307dfb
Compare
First, thanks for tackling this @e3243eric! At this point this issue is a bit older and I have a few thoughts I wanted to throw around. This strays a bit further from a
With the above in mind, I think I lean towards only requiring this for python versions below 3.8, otherwise importing the So... in install_requires=[
"eth-hash>=0.3.1,<0.6.0",
"eth-typing>=3.0.0,<4.0.0",
"toolz>0.8.2,<1;implementation_name=='pypy'",
"cytoolz>=0.10.1,<1.0.0;implementation_name=='cpython'",
"cached-property>=1.5.2,<2; python_version < '3.8'", # this is the relevant change
], Then in logging.py: import sys
if sys.version_info < (3, 8):
from cached_property import cached_property
else:
from functools import cached_property I believe the above should work. Curious on others' thoughts here. |
…on is newer than 3.8
I updated the code like the @fselmo comment, it works, but I got a lint issue.
I can pass the CI because the python version of CI lint is 3.6. |
Hmm I think this is OK. We should probably drop 3.6 support and update the |
@fselmo - Yep, this is the solution I would do too. Thanks for all the PRs @e3243eric! |
What was wrong?
Issue #159
How was it fixed?
Replace
cached_show_debug2_property
withcached_property
, and add the cached-property package ininstall_requires
.cached_property
has the untyped issue, so I add the# type: ignore
.To-Do
Cute Animal Picture