From b288e3a006545cb72f36361549b496537666f53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Wed, 18 Jan 2017 14:32:38 -0800 Subject: [PATCH] Use canonical "is None" checks instead of "== None" --- python2/typing.py | 4 ++-- src/typing.py | 4 ++-- tox.ini | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python2/typing.py b/python2/typing.py index 9d24306e6..35be99117 100644 --- a/python2/typing.py +++ b/python2/typing.py @@ -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().") diff --git a/src/typing.py b/src/typing.py index bca3a2de3..f389bfb22 100644 --- a/src/typing.py +++ b/src/typing.py @@ -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().") diff --git a/tox.ini b/tox.ini index 42698b3ef..056a5b1ca 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,6 @@ ignore = E128, E129, E501, - E711, W503, # irrelevant plugins B3,