Skip to content

Use canonical "is None" checks instead of "== None" #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python2/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,13 +1268,13 @@ def __getitem__(self, parameters):
return super(TupleMeta, self).__getitem__(parameters)

def __instancecheck__(self, obj):
if self.__args__ == None:
if self.__args__ is None:
return isinstance(obj, tuple)
raise TypeError("Parameterized Tuple cannot be used "
"with isinstance().")

def __subclasscheck__(self, cls):
if self.__args__ == None:
if self.__args__ is None:
return issubclass(cls, tuple)
raise TypeError("Parameterized Tuple cannot be used "
"with issubclass().")
Expand Down
4 changes: 2 additions & 2 deletions src/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,13 +1193,13 @@ def __getitem__(self, parameters):
return super().__getitem__(parameters)

def __instancecheck__(self, obj):
if self.__args__ == None:
if self.__args__ is None:
return isinstance(obj, tuple)
raise TypeError("Parameterized Tuple cannot be used "
"with isinstance().")

def __subclasscheck__(self, cls):
if self.__args__ == None:
if self.__args__ is None:
return issubclass(cls, tuple)
raise TypeError("Parameterized Tuple cannot be used "
"with issubclass().")
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ignore =
E128,
E129,
E501,
E711,
W503,
# irrelevant plugins
B3,
Expand Down