Skip to content

Commit 0757a26

Browse files
committed
Update mypy type ignore statements
1 parent 2581c2b commit 0757a26

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fgpyo/util/inspect.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@
5050
_use_attr = False
5151
attr = None
5252
ATTR_NOTHING = None
53-
Attribute = TypeVar("Attribute", bound=object) # type: ignore
53+
Attribute = TypeVar("Attribute", bound=object) # type: ignore[misc, assignment]
5454

5555
# define empty placeholders for getting attr fields as a tuple or dict. They will never be
5656
# called because the import failed; but they're here to ensure that the function is defined in
5757
# sections of code that don't know if the import was successful or not.
5858

59-
def get_attr_fields(cls: type) -> Tuple[dataclasses.Field, ...]: # type: ignore
59+
def get_attr_fields(cls: type) -> Tuple[dataclasses.Field, ...]: # type: ignore[misc]
6060
"""Get tuple of fields for attr class. attrs isn't imported so return empty tuple."""
6161
return ()
6262

63-
def get_attr_fields_dict(cls: type) -> Dict[str, dataclasses.Field]: # type: ignore
63+
def get_attr_fields_dict(cls: type) -> Dict[str, dataclasses.Field]: # type: ignore[misc]
6464
"""Get dict of name->field for attr class. attrs isn't imported so return empty dict."""
6565
return {}
6666

@@ -79,11 +79,11 @@ class DataclassesProtocol(Protocol):
7979
from attr import AttrsInstance
8080
else:
8181

82-
class AttrsInstance(Protocol): # type: ignore
82+
class AttrsInstance(Protocol): # type: ignore[no-redef]
8383
__attrs_attrs__: Dict[str, Any]
8484

8585

86-
def is_attr_class(cls: type) -> bool: # type: ignore
86+
def is_attr_class(cls: type) -> bool: # type: ignore[arg-type]
8787
"""Return True if the class is an attr class, and False otherwise"""
8888
return hasattr(cls, "__attrs_attrs__")
8989

@@ -367,7 +367,7 @@ def attr_from(
367367
parsers: a dictionary of parser functions to apply to specific types
368368
"""
369369
return_values: Dict[str, Any] = {}
370-
for attribute in get_fields(cls): # type: ignore
370+
for attribute in get_fields(cls): # type: ignore[arg-type]
371371
return_value: Any
372372
if attribute.name in kwargs:
373373
str_value: str = kwargs[attribute.name]

0 commit comments

Comments
 (0)