mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 20:24:31 +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
|
||||
|
||||
|
||||
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