Skip to content

Commit 86050a8

Browse files
committed
refactor: imports from typing instead of typing-extensions
1 parent a725917 commit 86050a8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tortoise/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
from collections.abc import Awaitable, Callable, Generator, Iterable
77
from copy import copy, deepcopy
88
from functools import partial
9-
from typing import Any, TypedDict, TypeVar, cast
9+
from typing import TYPE_CHECKING, Any, TypedDict, TypeVar, cast
1010

1111
from pypika_tortoise import Order, Query, Table
1212
from pypika_tortoise.terms import Term
13-
from typing_extensions import Self
1413

1514
from tortoise import connections
1615
from tortoise.backends.base.client import BaseDBAsyncClient
@@ -54,6 +53,9 @@
5453
from tortoise.signals import Signals
5554
from tortoise.transactions import in_transaction
5655

56+
if TYPE_CHECKING:
57+
from typing_extensions import Self
58+
5759
MODEL = TypeVar("MODEL", bound="Model")
5860
EMPTY = object()
5961

tortoise/queryset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
from collections import defaultdict
55
from collections.abc import AsyncIterator, Callable, Collection, Generator, Iterable
66
from copy import copy
7-
from typing import TYPE_CHECKING, Any, Generic, Optional, TypeVar, cast, overload
7+
from typing import TYPE_CHECKING, Any, Generic, Literal, Optional, Protocol, TypeVar, cast, overload
88

99
from pypika_tortoise import JoinType, Order, Table
1010
from pypika_tortoise.analytics import Count
1111
from pypika_tortoise.functions import Cast
1212
from pypika_tortoise.queries import QueryBuilder
1313
from pypika_tortoise.terms import Case, Field, Star, Term, ValueWrapper
14-
from typing_extensions import Literal, Protocol
1514

1615
from tortoise.backends.base.client import BaseDBAsyncClient, Capabilities
1716
from tortoise.exceptions import (

0 commit comments

Comments
 (0)