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