From 01302154758c0eace8a602ab6cb0a48383cf5c74 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Thu, 3 Nov 2022 18:07:18 +0900 Subject: [PATCH] fix: [E713](https://github.com/PyCQA/pycodestyle/blob/2.9.1/docs/intro.rst#error-codes) --- lib/yaml/constructor.py | 4 ++-- lib/yaml/representer.py | 4 ++-- lib/yaml/resolver.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/yaml/constructor.py b/lib/yaml/constructor.py index e335e1f0..8949d475 100644 --- a/lib/yaml/constructor.py +++ b/lib/yaml/constructor.py @@ -164,13 +164,13 @@ def construct_pairs(self, node, deep=False): @classmethod def add_constructor(cls, tag, constructor): - if not 'yaml_constructors' in cls.__dict__: + if 'yaml_constructors' not in cls.__dict__: cls.yaml_constructors = cls.yaml_constructors.copy() cls.yaml_constructors[tag] = constructor @classmethod def add_multi_constructor(cls, tag_prefix, multi_constructor): - if not 'yaml_multi_constructors' in cls.__dict__: + if 'yaml_multi_constructors' not in cls.__dict__: cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy() cls.yaml_multi_constructors[tag_prefix] = multi_constructor diff --git a/lib/yaml/representer.py b/lib/yaml/representer.py index 9d34c0d7..fd13479e 100644 --- a/lib/yaml/representer.py +++ b/lib/yaml/representer.py @@ -68,13 +68,13 @@ def represent_data(self, data): @classmethod def add_representer(cls, data_type, representer): - if not 'yaml_representers' in cls.__dict__: + if 'yaml_representers' not in cls.__dict__: cls.yaml_representers = cls.yaml_representers.copy() cls.yaml_representers[data_type] = representer @classmethod def add_multi_representer(cls, data_type, representer): - if not 'yaml_multi_representers' in cls.__dict__: + if 'yaml_multi_representers' not in cls.__dict__: cls.yaml_multi_representers = cls.yaml_multi_representers.copy() cls.yaml_multi_representers[data_type] = representer diff --git a/lib/yaml/resolver.py b/lib/yaml/resolver.py index 3522bdaa..a7802a75 100644 --- a/lib/yaml/resolver.py +++ b/lib/yaml/resolver.py @@ -24,7 +24,7 @@ def __init__(self): @classmethod def add_implicit_resolver(cls, tag, regexp, first): - if not 'yaml_implicit_resolvers' in cls.__dict__: + if 'yaml_implicit_resolvers' not in cls.__dict__: implicit_resolvers = {} for key in cls.yaml_implicit_resolvers: implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:] @@ -48,7 +48,7 @@ def add_path_resolver(cls, tag, path, kind=None): # a mapping value that corresponds to a scalar key which content is # equal to the `index_check` value. An integer `index_check` matches # against a sequence value with the index equal to `index_check`. - if not 'yaml_path_resolvers' in cls.__dict__: + if 'yaml_path_resolvers' not in cls.__dict__: cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy() new_path = [] for element in path: