From e0e8814804b949231e761bd69aefb6fac31ce7a4 Mon Sep 17 00:00:00 2001 From: Maxim Kurnikov Date: Tue, 5 Mar 2019 19:11:02 +0300 Subject: [PATCH] Revert "dont convert to optional, if anytype" This reverts commit 53f5d2214b3984852bf1a2f8ddeefbb90ba8c9ae. --- mypy_django_plugin/helpers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mypy_django_plugin/helpers.py b/mypy_django_plugin/helpers.py index 90e49b4..ee3a98b 100644 --- a/mypy_django_plugin/helpers.py +++ b/mypy_django_plugin/helpers.py @@ -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()])