Skip to content

Commit

Permalink
chore(typing): define only stubs when under TYPE_CHECKING
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 committed Apr 5, 2024
1 parent 832cabc commit 4c4709f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions falcon/util/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,13 @@ class Context:
if TYPE_CHECKING:

def __getattr__(self, name: str) -> Any:
try:
return self.__dict__[name]
except KeyError:
raise AttributeError(name) from None
...

def __setattr__(self, name: str, value: Any) -> None:
self.__dict__[name] = value
...

def __delattr__(self, name: str) -> None:
try:
del self.__dict__[name]
except KeyError:
raise AttributeError(name) from None
...

def __contains__(self, key: str) -> bool:
return self.__dict__.__contains__(key)
Expand Down

0 comments on commit 4c4709f

Please sign in to comment.