pep8: Use "X not in Y" instead of "not X in Y"
flake8 --select E713, semi-manual fixing
This commit is contained in:
parent
31a96228db
commit
21e8f82fd7
57 changed files with 81 additions and 83 deletions
|
|
@ -392,7 +392,7 @@ class BaseObject(object):
|
|||
try:
|
||||
attr = (self._fields or {})[name]
|
||||
except KeyError:
|
||||
if not name in dir(self) and not name.startswith('_'):
|
||||
if name not in dir(self) and not name.startswith('_'):
|
||||
warnings.warn('Creating a non-field attribute %s. Please prefix it with _' % name,
|
||||
AttributeCreationWarning, stacklevel=2)
|
||||
object.__setattr__(self, name, value)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class Contact(BaseObject):
|
|||
:type name: str
|
||||
:param kwargs: See :class:`ContactPhoto` to know what other parameters you can use
|
||||
"""
|
||||
if not name in self.photos:
|
||||
if name not in self.photos:
|
||||
self.photos[name] = ContactPhoto(name)
|
||||
|
||||
photo = self.photos[name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue