diff --git a/src/py/autowig/asg.py b/src/py/autowig/asg.py index 69708057..cad27605 100644 --- a/src/py/autowig/asg.py +++ b/src/py/autowig/asg.py @@ -1591,26 +1591,26 @@ def add_directory(self, dirname): initname = str(dirname) if not initname.endswith(os.sep): initname += os.sep - if not initname in self._nodes: + if initname not in self._nodes: idparent = initname - if not idparent in self._syntax_edges: + if idparent not in self._syntax_edges: self._syntax_edges[idparent] = [] while not dirname == os.sep: idnode = idparent if not idnode.endswith(os.sep): idnode += os.sep - if not idnode in self._nodes: + if idnode not in self._nodes: self._nodes[idnode] = dict(_proxy=DirectoryProxy) dirname = dirname.parent idparent = str(dirname) if not idparent.endswith(os.sep): idparent += os.sep - if not idparent in self._syntax_edges: + if idparent not in self._syntax_edges: self._syntax_edges[idparent] = [] self._syntax_edges[idparent].append(idnode) else: break - if dirname == os.sep and not os.sep in self._nodes: + if dirname == os.sep and os.sep not in self._nodes: self._nodes[os.sep] = dict(_proxy=DirectoryProxy) return self[initname] @@ -1618,13 +1618,13 @@ def add_file(self, filename, **kwargs): filename = path(filename).abspath() initname = str(filename) proxy = kwargs.pop('proxy', FileProxy) - if not initname in self._nodes: + if initname not in self._nodes: idnode = str(filename) self._nodes[idnode] = dict(_proxy=proxy, **kwargs) idparent = str(filename.parent) if not idparent.endswith(os.sep): idparent += os.sep - if not idparent in self._syntax_edges: + if idparent not in self._syntax_edges: self._syntax_edges[idparent] = [] self._syntax_edges[idparent].append(idnode) self.add_directory(idparent) @@ -1729,7 +1729,7 @@ def dependencies(self, *nodes): while len(white) > 0: node = white.pop() - if not node._node in black: + if node._node not in black: black.add(node._node) parent = node.parent if not isinstance(parent, NamespaceProxy) and visitor(parent): diff --git a/src/py/autowig/boost_python_generator.py b/src/py/autowig/boost_python_generator.py index fbcfb17a..34d98401 100644 --- a/src/py/autowig/boost_python_generator.py +++ b/src/py/autowig/boost_python_generator.py @@ -674,7 +674,7 @@ def _feedback(self, row): if not parsed: parsed = parse.parse(' class_{hash}.def({python}, {cpp}, {documentation});', line) if parsed: - if not 'what' in parsed.named: + if 'what' not in parsed.named: if parsed['cpp'].startswith('method_pointer_'): pointer = parsed['cpp'] parsed = None diff --git a/src/py/autowig/libclang_parser.py b/src/py/autowig/libclang_parser.py index abf04ba8..0cee10dc 100644 --- a/src/py/autowig/libclang_parser.py +++ b/src/py/autowig/libclang_parser.py @@ -282,7 +282,7 @@ def read_enum(asg, cursor, scope): return children else: spelling = 'enum ' + spelling - if not spelling in asg: + if spelling not in asg: asg._syntax_edges[spelling] = [] asg._nodes[spelling] = dict(_proxy = EnumerationProxy, _comment = "", @@ -334,7 +334,7 @@ def read_typedef(asg, typedef, scope): spelling = spelling + "::" + typedef.spelling else: spelling = spelling + typedef.spelling - if not spelling in asg: + if spelling not in asg: try: with warnings.catch_warnings(): warnings.simplefilter("error") @@ -536,7 +536,7 @@ def read_tag(asg, cursor, scope): spelling = 'union ' + spelling else: spelling = 'class ' + spelling - if not spelling in asg: + if spelling not in asg: if cursor.kind in [CursorKind.STRUCT_DECL, CursorKind.UNION_DECL]: asg._nodes[spelling] = dict(_proxy=ClassProxy, _is_abstract=True, @@ -614,11 +614,11 @@ def read_namespace(asg, cursor, scope): read_access(asg, cursor.access_specifier, *children) return children else: - if not spelling in asg: + if spelling not in asg: asg._nodes[spelling] = dict(_proxy=NamespaceProxy, _is_inline=False) # TODO asg._syntax_edges[spelling] = [] - if not spelling in asg._syntax_edges[scope]: + if spelling not in asg._syntax_edges[scope]: asg._syntax_edges[scope].append(spelling) for child in cursor.get_children(): read_cursor(asg, child, spelling) diff --git a/src/py/autowig/proxy_manager.py b/src/py/autowig/proxy_manager.py index 65c61154..0fa4c6f3 100644 --- a/src/py/autowig/proxy_manager.py +++ b/src/py/autowig/proxy_manager.py @@ -74,7 +74,7 @@ def __setitem__(self, proxy, cls): if issubclass(cls, self._base): self._cache[proxy] = cls elif isinstance(cls, basestring): - if not cls in self: + if cls not in self: raise ValueError('\'cls\' parameter must be an existing proxy') if proxy == cls: raise ValueError('\'proxy\' and \'cls\' parameters cannot have the same value')