third_party.pylibs.pylint.src/test/input/func_noerror_mcs_attr_access.py
FELD Boris 1a8aa86961 Improve checking of metaclass methods's first arg. Closes #4014.
* Add C0204 for __new__ method of metaclass.
* Add valid-metaclass-classmethod-first-arg config option.
* Move a test, improve it and fix another one.
2012-09-19 14:04:03 +02:00

21 lines
469 B
Python

# pylint: disable=R0903
"""test attribute access on metaclass"""
__revision__ = 'yo'
class Meta(type):
"""the meta class"""
def __init__(cls, name, bases, dictionary):
super(Meta, cls).__init__(name, bases, dictionary)
print cls, cls._meta_args
delattr(cls, '_meta_args')
class Test(object):
"""metaclassed class"""
__metaclass__ = Meta
_meta_args = ('foo', 'bar')
def __init__(self):
print '__init__', self