This repository was archived by the owner on Oct 4, 2023. It is now read-only.
Open
Conversation
|
Please note: this library may not be actively maintained (see #17). The changes in #11 offer a similar solution that should (I think?) also be Python 3.11 compatible. A tradeoff is that #11 avoids conditional assignment to |
jayaddison
reviewed
Jan 5, 2023
|
|
||
| __aexit__ = asyncio.coroutine(RateLimiter.__exit__) | ||
| # backward behavior for python 3.5 - 3.10; no need for decorator if deprecated in python > 3.11 | ||
| __aexit__ = asyncio.coroutine(RateLimiter.__exit__) if hasattr(asyncio, 'coroutine') else RateLimiter.__exit__ |
There was a problem hiding this comment.
Hey @brainysmurf - have you tested whether returning RateLimiter.__exit__ behaves as expected on Python 3.11? (it's declared using def, not async def, which is what has me wondering)
There was a problem hiding this comment.
Doesn't work as expected. Implemented the changes and when called I get:
name 'RateLimiter' is not defined
And the error points to "RateLimiter.exit"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backward behavior for python 3.5 - 3.10; no need for decorator if deprecated in python >= 3.11