From 75b4d951fc9a86482d74e9b3be78f7f126b9b5e9 Mon Sep 17 00:00:00 2001 From: Sergey Fursov Date: Thu, 11 Apr 2019 14:20:14 +0300 Subject: [PATCH] Use `is` instead of equality for comparing with None --- lib/yaml/__init__.py | 4 ++-- lib3/yaml/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/yaml/__init__.py b/lib/yaml/__init__.py index 48b33b3c..b0826a51 100644 --- a/lib/yaml/__init__.py +++ b/lib/yaml/__init__.py @@ -335,7 +335,7 @@ def add_constructor(tag, constructor, Loader=None): Constructor is a function that accepts a Loader instance and a node object and produces the corresponding Python object. """ - if Loader == None: + if Loader is None: loader.Loader.add_constructor(tag, constructor) loader.FullLoader.add_constructor(tag, constructor) loader.UnsafeLoader.add_constructor(tag, constructor) @@ -349,7 +349,7 @@ def add_multi_constructor(tag_prefix, multi_constructor, Loader=None): Multi-constructor accepts a Loader instance, a tag suffix, and a node object and produces the corresponding Python object. """ - if Loader == None: + if Loader is None: loader.Loader.add_multi_constructor(tag_prefix, multi_constructor) loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor) loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor) diff --git a/lib3/yaml/__init__.py b/lib3/yaml/__init__.py index 183969e5..52272a90 100644 --- a/lib3/yaml/__init__.py +++ b/lib3/yaml/__init__.py @@ -332,7 +332,7 @@ def add_constructor(tag, constructor, Loader=None): Constructor is a function that accepts a Loader instance and a node object and produces the corresponding Python object. """ - if Loader == None: + if Loader is None: loader.Loader.add_constructor(tag, constructor) loader.FullLoader.add_constructor(tag, constructor) loader.UnsafeLoader.add_constructor(tag, constructor) @@ -346,7 +346,7 @@ def add_multi_constructor(tag_prefix, multi_constructor, Loader=None): Multi-constructor accepts a Loader instance, a tag suffix, and a node object and produces the corresponding Python object. """ - if Loader == None: + if Loader is None: loader.Loader.add_multi_constructor(tag_prefix, multi_constructor) loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor) loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor)