Skip to content

Commit 49f7c23

Browse files
fix: re-enable reportInvalidTypeForm (#1387)
Signed-off-by: arielle <[email protected]> Co-authored-by: vi <[email protected]>
1 parent 7fa6577 commit 49f7c23

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

disnake/enums.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ def _is_descriptor(obj) -> bool:
117117
return hasattr(obj, "__get__") or hasattr(obj, "__set__") or hasattr(obj, "__delete__")
118118

119119

120-
EnumMetaT = TypeVar("EnumMetaT", bound="EnumMeta")
121-
122-
123120
class EnumMeta(type):
124121
if TYPE_CHECKING:
125122
__name__: ClassVar[str]
@@ -166,10 +163,10 @@ def __new__(cls: EnumMetaT, name: str, bases, attrs, *, comparable: bool = False
166163
value_cls._actual_enum_cls_ = actual_cls # type: ignore
167164
return actual_cls
168165

169-
def __iter__(cls: EnumMetaT) -> Iterator[EnumMetaT]:
166+
def __iter__(cls) -> Iterator[EnumMetaT]:
170167
return (cls._enum_member_map_[name] for name in cls._enum_member_names_)
171168

172-
def __reversed__(cls: EnumMetaT) -> Iterator[EnumMetaT]:
169+
def __reversed__(cls) -> Iterator[EnumMetaT]:
173170
return (cls._enum_member_map_[name] for name in reversed(cls._enum_member_names_))
174171

175172
def __len__(cls) -> int:

disnake/ext/commands/params.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@
8686
else:
8787
P = TypeVar("P")
8888

89+
8990
if sys.version_info >= (3, 10):
9091
from types import EllipsisType, UnionType
92+
elif TYPE_CHECKING:
93+
EllipsisType = type(Ellipsis)
94+
UnionType = NoReturn
95+
9196
else:
9297
UnionType = object()
9398
EllipsisType = type(Ellipsis)

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ reportIncompatibleVariableOverride = false
370370
# these were added in the upgrade from pyright 1.1.336 to 1.1.405
371371
reportInconsistentOverload = false
372372
reportInvalidTypeVarUse = false
373-
reportInvalidTypeForm = false
374373

375374
# these are largely due to missing type hints, and make up most of the error count
376375
reportUnknownMemberType = false

0 commit comments

Comments
 (0)