def func(): value = "not-none" # noinspection SomeInspection if value is None: print("None") print(value)