-
Notifications
You must be signed in to change notification settings - Fork 55
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 ParamSpec for wrapped signatures #508
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #508 +/- ##
==========================================
+ Coverage 96.88% 96.92% +0.03%
==========================================
Files 12 12
Lines 770 780 +10
Branches 91 93 +2
==========================================
+ Hits 746 756 +10
Misses 22 22
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good step forward, thanks!
files = async_lru, tests | ||
check_untyped_defs = True | ||
follow_imports_for_stubs = True | ||
disallow_any_decorated = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a reason for enumerating all mypy options?
I would prefer strict = true
plus maybe a few additional fine-tunes.
Maintaining all mypy opts adds a burden; I never could keep all these options in my mind without looking in docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a lot more options than strict. This is the config we started in aiohttp a few years ago. Basically, strict isn't so strict, so we like to enable all the options that aren't too much.
At some point I'd like to find a way to make a config that's reusable across all projects without copy/paste, which will ease the maintenance burden.
Fixes #504.
There are still a couple of issues with this.
partial()
use will cause new type errors. We can either wait until partial() is properly supported by typedshed/mypy (functools.partial should use PEP612 ParamSpec (depends on #8708) python/typeshed#8703 / functools.partial support python/mypy#1484), or we could expose aTypeAlias
of_LRUCacheWrapper
so it can be used in type annotations.There also seems to be an issue with pypy, possibly a bug in pypy, but needs further investigation.