summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-11-09 15:03:17 +1000
committerBenjamin Tissoires <benjamin.tissoires@gmail.com>2016-11-09 15:47:27 +0100
commita3ed500af3c2545c445be17620a6a5e05a7d78eb (patch)
tree13a735923106227cdb54e179f717ea9f4769e8f5
parent5d7b1839e8f6b2472008a39f4abfc7d78b0cfd22 (diff)
python: use "is None" instead of "== None"
A fairly subtle difference, but "is None" is preferred. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
-rw-r--r--python/evemu/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
index 5dfffd9..230559f 100644
--- a/python/evemu/__init__.py
+++ b/python/evemu/__init__.py
@@ -55,7 +55,7 @@ def event_get_value(event_type, event_code = None):
t = _libevdev.libevdev_event_type_from_name(str(event_type))
- if event_code == None:
+ if event_code is None:
return None if t < 0 else t
if isinstance(event_code, int):
@@ -79,17 +79,17 @@ def event_get_name(event_type, event_code = None):
if not isinstance(event_type, int):
event_type = event_get_value(event_type)
- if event_type == None:
+ if event_type is None:
return None
- if event_code == None:
+ if event_code is None:
type_name = _libevdev.libevdev_event_type_get_name(event_type)
return None if type_name == 0 else type_name
if not isinstance(event_code, int):
event_code = event_get_value(event_type, event_code)
- if event_code == None:
+ if event_code is None:
return None
code_name = _libevdev.libevdev_event_code_get_name(event_type, event_code)
@@ -103,7 +103,7 @@ def input_prop_get_name(prop):
if not isinstance(prop, int):
prop = input_prop_get_value(prop)
- if prop == None:
+ if prop is None:
return None
prop = _libevdev.libevdev_property_get_name(prop)
@@ -116,7 +116,7 @@ def input_prop_get_value(prop):
if isinstance(prop, int):
prop = input_prop_get_name(prop)
- if prop == None:
+ if prop is None:
return None
prop = _libevdev.libevdev_property_from_name(str(prop))