Skip to content

Commit

Permalink
Import override from typing_extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Jul 31, 2024
1 parent a652aaa commit 7a59a36
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chess/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
from types import TracebackType
from typing import Any, Callable, Coroutine, Deque, Dict, Generator, Generic, Iterable, Iterator, List, Literal, Mapping, MutableMapping, Optional, Tuple, Type, TypedDict, TypeVar, Union

try:
from typing import override
except:
# Before Python 3.12
if typing.TYPE_CHECKING:
from typing_extensions import override
else:
F = typing.TypeVar("F", bound=Callable[..., Any])
def override(fn: F, /) -> F:
return fn
Expand Down

0 comments on commit 7a59a36

Please sign in to comment.