Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pycqa/pep8-naming
1 result
Show changes
Commits on Source (3)
Changes
=======
 
0.6.1 - 2018-05-06
------------------
* Fix N804 check for ``cls`` used in metaclass methods (See also
https://github.com/PyCQA/pep8-naming/issues/53)
0.6.0 - 2018-05-04
------------------
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ try:
except ImportError:
from flake8.util import ast, iter_child_nodes
 
__version__ = '0.6.0'
__version__ = '0.6.1'
 
LOWERCASE_REGEX = re.compile(r'[_a-z][_a-z0-9]*$')
UPPERCASE_REGEX = re.compile(r'[_A-Z][_A-Z0-9]*$')
Loading
Loading
@@ -180,9 +180,10 @@ class NamingChecker(object):
if isinstance(meth, ast.Name):
late_decoration[meth.id] = self.decorator_to_type[func_name]
 
cls_bases = [b for b in cls_node.bases if isinstance(b, ast.Name)]
# If this class inherits from `type`, it's a metaclass, and we'll
# consider all of it's methods to be classmethods.
ismetaclass = any(name for name in cls_node.bases if name.id == 'type')
ismetaclass = any(name for name in cls_bases if name.id == 'type')
 
# iterate over all functions and tag them
for node in iter_child_nodes(cls_node):
Loading
Loading
Loading
Loading
@@ -27,3 +27,10 @@ class Meta(type):
class MetaMethod(type):
def test(cls):
pass
#: Okay
class NotMeta(object):
otherclass = Foo
class AttributeParent(NotMeta.otherclass):
pass
class CallParent(type('_tmp', (), {})):
pass