mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-11 15:49:17 +08:00
dont convert to optional, if anytype
This commit is contained in:
1 parent
9e4ed70fc5
commit
53f5d2214b
1 file changed
+3
-1
@@ -254,7 +254,9 @@ def extract_primary_key_type_for_get(model: TypeInfo) -> Optional[Type]:
|
||||
return None
|
||||
|
||||
|
||||
def make_optional(typ: Type):
|
||||
def make_optional(typ: Type) -> UnionType:
|
||||
if isinstance(typ, AnyType):
|
||||
return typ
|
||||
return UnionType.make_union([typ, NoneTyp()])
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user