Skip to content

Commit acacc31

Browse files
committed
Mute mypy errors on field property assignment
1 parent 90897c4 commit acacc31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

osc/util/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def __init__(self, field_name, *, fallback=NotSet):
8888
def __repr__(self):
8989
return f"FromParent(field_name={self.field_name})"
9090

91-
92-
class Field(property):
91+
# HACK: inheriting from Any fixes the following mypy error:
92+
# Incompatible types in assignment (expression has type "Field", variable has type "X | None") [assignment]
93+
class Field(property, *([Any] if typing.TYPE_CHECKING else [])):
9394
def __init__(
9495
self,
9596
default: Any = NotSet,

0 commit comments

Comments
 (0)