Skip to content

Commit 9413e2d

Browse files
committed
refactor(collection): make TDoc typevar covariant in collection classes
1 parent 469e6d6 commit 9413e2d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/typesense/collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from typesense.synonyms import Synonyms
3636
from typesense.types.document import DocumentSchema
3737

38-
TDoc = typing.TypeVar("TDoc", bound=DocumentSchema)
38+
TDoc = typing.TypeVar("TDoc", bound=DocumentSchema, covariant=True)
3939

4040

4141
class Collection(typing.Generic[TDoc]):

src/typesense/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from typesense.types.collection import CollectionCreateSchema, CollectionSchema
2929
from typesense.types.document import DocumentSchema
3030

31-
TDoc = typing.TypeVar("TDoc", bound=DocumentSchema)
31+
TDoc = typing.TypeVar("TDoc", bound=DocumentSchema, covariant=True)
3232

3333

3434
class Collections(typing.Generic[TDoc]):

0 commit comments

Comments
 (0)