dont convert to optional, if anytype

This commit is contained in:
Maxim Kurnikov
2019-03-05 18:43:10 +03:00
parent 9e4ed70fc5
commit 53f5d2214b

View File

@@ -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()])