Skip to content

Commit 17e1b5b

Browse files
ambvilevkivskyi
authored andcommitted
Use canonical "is None" checks instead of "== None" (#358)
1 parent 6590133 commit 17e1b5b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

python2/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,13 +1268,13 @@ def __getitem__(self, parameters):
12681268
return super(TupleMeta, self).__getitem__(parameters)
12691269

12701270
def __instancecheck__(self, obj):
1271-
if self.__args__ == None:
1271+
if self.__args__ is None:
12721272
return isinstance(obj, tuple)
12731273
raise TypeError("Parameterized Tuple cannot be used "
12741274
"with isinstance().")
12751275

12761276
def __subclasscheck__(self, cls):
1277-
if self.__args__ == None:
1277+
if self.__args__ is None:
12781278
return issubclass(cls, tuple)
12791279
raise TypeError("Parameterized Tuple cannot be used "
12801280
"with issubclass().")

src/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,13 +1193,13 @@ def __getitem__(self, parameters):
11931193
return super().__getitem__(parameters)
11941194

11951195
def __instancecheck__(self, obj):
1196-
if self.__args__ == None:
1196+
if self.__args__ is None:
11971197
return isinstance(obj, tuple)
11981198
raise TypeError("Parameterized Tuple cannot be used "
11991199
"with isinstance().")
12001200

12011201
def __subclasscheck__(self, cls):
1202-
if self.__args__ == None:
1202+
if self.__args__ is None:
12031203
return issubclass(cls, tuple)
12041204
raise TypeError("Parameterized Tuple cannot be used "
12051205
"with issubclass().")

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ignore =
1616
E128,
1717
E129,
1818
E501,
19-
E711,
2019
W503,
2120
# irrelevant plugins
2221
B3,

0 commit comments

Comments
 (0)