This commit is contained in:
Mike Ribbons 2025-02-04 23:50:35 +01:00 committed by GitHub
commit 0e0fcbceec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 18 deletions

View File

@ -28,9 +28,6 @@ from .underscore import Underscore
DOCBIN_ALL_ATTRS: Tuple[str, ...]
class DocMethod(Protocol):
def __call__(self: Doc, *args: Any, **kwargs: Any) -> Any: ... # type: ignore[misc]
class Doc:
vocab: Vocab
mem: Pool
@ -53,7 +50,7 @@ class Doc:
default: Optional[Any] = ...,
getter: Optional[Callable[[Doc], Any]] = ...,
setter: Optional[Callable[[Doc, Any], None]] = ...,
method: Optional[DocMethod] = ...,
method: Optional[Callable[[Doc, Any]]] = ...,
force: bool = ...,
) -> None: ...
@classmethod
@ -61,7 +58,7 @@ class Doc:
cls, name: str
) -> Tuple[
Optional[Any],
Optional[DocMethod],
Optional[Callable[[Doc, Any]]],
Optional[Callable[[Doc], Any]],
Optional[Callable[[Doc, Any], None]],
]: ...
@ -72,7 +69,7 @@ class Doc:
cls, name: str
) -> Tuple[
Optional[Any],
Optional[DocMethod],
Optional[Callable[[Doc, Any]]],
Optional[Callable[[Doc], Any]],
Optional[Callable[[Doc, Any], None]],
]: ...

View File

@ -8,9 +8,6 @@ from .doc import Doc
from .token import Token
from .underscore import Underscore
class SpanMethod(Protocol):
def __call__(self: Span, *args: Any, **kwargs: Any) -> Any: ... # type: ignore[misc]
class Span:
@classmethod
def set_extension(
@ -19,7 +16,7 @@ class Span:
default: Optional[Any] = ...,
getter: Optional[Callable[[Span], Any]] = ...,
setter: Optional[Callable[[Span, Any], None]] = ...,
method: Optional[SpanMethod] = ...,
method: Optional[Callable[[Span, Any]]] = ...,
force: bool = ...,
) -> None: ...
@classmethod
@ -27,7 +24,7 @@ class Span:
cls, name: str
) -> Tuple[
Optional[Any],
Optional[SpanMethod],
Optional[Callable[[Span, Any]]],
Optional[Callable[[Span], Any]],
Optional[Callable[[Span, Any], None]],
]: ...
@ -38,7 +35,7 @@ class Span:
cls, name: str
) -> Tuple[
Optional[Any],
Optional[SpanMethod],
Optional[Callable[[Span, Any]]],
Optional[Callable[[Span], Any]],
Optional[Callable[[Span, Any], None]],
]: ...

View File

@ -9,9 +9,6 @@ from .morphanalysis import MorphAnalysis
from .span import Span
from .underscore import Underscore
class TokenMethod(Protocol):
def __call__(self: Token, *args: Any, **kwargs: Any) -> Any: ... # type: ignore[misc]
class Token:
i: int
doc: Doc
@ -23,7 +20,7 @@ class Token:
default: Optional[Any] = ...,
getter: Optional[Callable[[Token], Any]] = ...,
setter: Optional[Callable[[Token, Any], None]] = ...,
method: Optional[TokenMethod] = ...,
method: Optional[Callable[[Token, Any]]] = ...,
force: bool = ...,
) -> None: ...
@classmethod
@ -31,7 +28,7 @@ class Token:
cls, name: str
) -> Tuple[
Optional[Any],
Optional[TokenMethod],
Optional[Callable[[Token, Any]]],
Optional[Callable[[Token], Any]],
Optional[Callable[[Token, Any], None]],
]: ...
@ -42,7 +39,7 @@ class Token:
cls, name: str
) -> Tuple[
Optional[Any],
Optional[TokenMethod],
Optional[Callable[[Token, Any]]],
Optional[Callable[[Token], Any]],
Optional[Callable[[Token, Any], None]],
]: ...