mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 04:34:29 +08:00
dont convert to optional, if anytype
This commit is contained in:
@@ -254,7 +254,9 @@ def extract_primary_key_type_for_get(model: TypeInfo) -> Optional[Type]:
|
|||||||
return None
|
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()])
|
return UnionType.make_union([typ, NoneTyp()])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user