mirror of
https://github.com/django-components/django-components.git
synced 2025-09-27 07:59:08 +00:00
Merge pull request #595 from hostnfly/fix-annotated-type
fix: mypy checking with django plugin is broken
This commit is contained in:
commit
83dcc3fe80
1 changed files with 2 additions and 2 deletions
|
@ -14,12 +14,12 @@ except ImportError:
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"Annotated[{self.type_}, {self.metadata[0]!r}, {self.metadata[1]!r}]"
|
return f"Annotated[{self.type_}, {self.metadata[0]!r}, {self.metadata[1]!r}]"
|
||||||
|
|
||||||
def __getitem__(self, params: Any) -> "Annotated": # type: ignore
|
def __getitem__(self, params: Any) -> "Annotated[Any, Any, Any]": # type: ignore
|
||||||
if not isinstance(params, tuple):
|
if not isinstance(params, tuple):
|
||||||
params = (params,)
|
params = (params,)
|
||||||
return Annotated(self.type_, *params, **self.metadata[1]) # type: ignore
|
return Annotated(self.type_, *params, **self.metadata[1]) # type: ignore
|
||||||
|
|
||||||
def __class_getitem__(self, *params: Any) -> "Annotated": # type: ignore
|
def __class_getitem__(self, *params: Any) -> "Annotated[Any, Any, Any]": # type: ignore
|
||||||
return Annotated(*params) # type: ignore
|
return Annotated(*params) # type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue