|
pylint #120006 type(name, bases, dict) not recognized as newstyle class [open]
Pylint is not identifying classes created using the second form of type() as newstyle clases.
$ cat test.py
MYCLASS = type('MyClass', (object,), {'my_fun': lambda x: 1})
class FooBar(MYCLASS):
def __init__(self):
pass
def my_fun(self):
return super(FooBar, self).my_fun()
print FooBar().my_fun()
$ python test.py
1
$ pylint test.py --reports=n
************* Module test
E: 7,4:FooBar.my_fun: Use of super on an old style class
| | priority | normal |
|---|
| type | bug |
|---|
| appeared in | <not specified> |
|---|
| done in | <not specified> |
|---|
| closed by | <not specified> |
|---|
|
Comments
yikes. Sorry about the formatting there.