vutran1710 / PyrateLimiter

⚔️Python Rate-Limiter using Leaky-Bucket Algorithm Family
https://pyratelimiter.readthedocs.io
MIT License
334 stars 36 forks source link

Fix typing for decorators #140

Closed ktmud closed 5 months ago

ktmud commented 8 months ago

Use generics to pass along the correct typing of the decorated functions.

The original type annotation is actually wrong, because it forces the wrapped function to have only 1 argument, which makes mypy complains.

image
vutran1710 commented 8 months ago

The ci failed, Can you check again?

ktmud commented 7 months ago

@vutran1710 I updated the code but the CI still failed at doc build---doesn't seem to be related to my change, can you take a look?

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (daa9c16) 98.40% compared to head (ae56fdc) 96.92%. Report is 8 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #140 +/- ## ========================================== - Coverage 98.40% 96.92% -1.48% ========================================== Files 13 13 Lines 690 716 +26 Branches 82 85 +3 ========================================== + Hits 679 694 +15 - Misses 6 15 +9 - Partials 5 7 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vutran1710 commented 6 months ago

@vutran1710 I updated the code but the CI still failed at doc build---doesn't seem to be related to my change, can you take a look?

maybe you have to sync with the master branch again first