I think it’s more the realm of code checkers like pyflakes, pychecker or pylint. From Python’s viewpoint, the behavior is perfectly legal and documented.