Subclassing ProgressBarBase causes pylint crash
🐛 Bug

Subclassing ProgressBarBase causes pylint crash
To Reproduce

Code sample

Say file: prog.py
from pytorch_lightning.callbacks.progress import ProgressBarBase

class ProgressBar(ProgressBarBase):
    ...
Run pylint:
$ pylint prog.py
Exceptions:


Traceback (most recent call last):
  File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/decorators.py", line 32, in cached
    return cache[func]
KeyError: >
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/bin/pylint", line 10, in 
sys.exit(run_pylint())
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/init.py", line 22, in run_pylint
PylintRun(sys.argv[1:])
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/lint/run.py", line 349, in init
linter.check(args)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 862, in check
self._check_files(
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 896, in _check_files
self._check_file(get_ast, check_astroid_module, name, filepath, modname)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 922, in _check_file
check_astroid_module(ast_node)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1054, in check_astroid_module
retval = self._check_astroid_module(
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1099, in _check_astroid_module
walker.walk(ast_node)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 72, in walk
callback(astroid)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/checkers/variables.py", line 1206, in visit_importfrom
module = self._check_module_attrs(node, module, name_parts[1:])
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/pylint/checkers/variables.py", line 1884, in _check_module_attrs
module = next(module.getattr(name)[0].infer())
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 547, in getattr
result = [self.import_module(name, relative_only=True)]
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
return MANAGER.ast_from_module_name(absmodname)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
return self.ast_from_file(found_spec.location, modname, fallback=False)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
return self._post_build(module, encoding)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
self.delayed_assattr(delayed)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/builder.py", line 234, in delayed_assattr
if not _can_assign_attr(inferred, node.attrname):
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/builder.py", line 59, in _can_assign_attr
slots = node.slots()
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/decorators.py", line 34, in cached
cache[func] = result = func(*args, **kwargs)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2833, in slots
slots = list(grouped_slots())
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2818, in grouped_slots
for cls in self.mro()[:-1]:
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2904, in mro
return self._compute_mro(context=context)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2894, in _compute_mro
return _c3_merge(unmerged_mro, self, context)
File "/home/pwwang/.cache/pypoetry/virtualenvs/prog-taq1idOW-py3.8/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 83, in _c3_merge
raise exceptions.InconsistentMroError(
astroid.exceptions.InconsistentMroError: Cannot create a consistent method resolution order for MROs (tqdm, Comparable, object), (tqdm_asyncio, tqdm, Comparable, object), (tqdm, tqdm_asyncio) of class <ClassDef.tqdm l.31 at 0x7f1ccee9f9a0>.



Expected behavior

There should be no exceptions
Environment

CUDA:
- GPU:
- available:         False
- version:           10.1
Packages:
- numpy:             1.19.2
- pyTorch_debug:     False
- pyTorch_version:   1.4.0
- pytorch-lightning: 0.10.0
- tqdm:              4.50.2
- pylint:       2.6.0
System:
- OS:                Linux
- architecture:
- 64bit
- ELF
- processor:
- python:            3.8.3
- version:           #1 SMP Wed Sep 23 19:45:38 PDT 2020

Additional context
I found this is caused by tqdm. However, tqdm itself alone didn't cause the crash. I tried prog.py with a simple tqdm use without any problems with pylint. This is why I posted it here, instead of tqdm's repo.
I tried various tqdm versions, ending up with 4.48.0, everything worked fine, but with any versions later, the exceptions were raised.
This was also reproduced with python 3.7.