Skip to content

Commit

Permalink
Use AttrName enum when attribute names are needed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdelorenzo committed Jan 29, 2022
1 parent 620d30f commit 84d2ab4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions limiter/limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import (
AsyncContextManager, ContextManager, Awaitable, TypedDict,
Final, cast
cast
)
from contextlib import (
AbstractContextManager, AbstractAsyncContextManager,
Expand All @@ -27,9 +27,6 @@
)


LIM_KEY: Final[str] = 'limiter'


class Attrs(TypedDict):
consume: Tokens
bucket: BucketName
Expand Down Expand Up @@ -128,7 +125,7 @@ def __call__(
@property
def attrs(self) -> Attrs:
attrs = asdict(self)
attrs.pop(LIM_KEY, None)
attrs.pop(AttrName.limiter, None)

return attrs

Expand Down

0 comments on commit 84d2ab4

Please sign in to comment.