pylint-bot / pylint-unofficial

UNOFFICIAL playground for pylint github migration
0 stars 0 forks source link

[bad-super-call] False positive when use inherit clases #680

Closed pylint-bot closed 8 years ago

pylint-bot commented 9 years ago

Originally reported by: Anonymous


Execute pylint -r n -d all -e bad-super-call FILE with next file:

import re

class MyClass1(object):
    'docstring'
    pass

class MyClass2(re.Scanner):
    'docstring'
    def __init__(self):
        'docstring'
        return super(MyClass1, self).__init__()

I expected: Fail bad-super-call

I saw: 0 fails

pylint==1.4.4 (latest from pypi)


pylint-bot commented 9 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


I presume this is on Python 2? The problem is that re.Scanner is an old style class and super can't be used with it. What will happen is that pylint will warn you about it and the code for bad-super-call will never be triggered.