This repository was archived by the owner on Mar 7, 2021. It is now read-only.
This repository was archived by the owner on Mar 7, 2021. It is now read-only.
Class method invocations without being defined raise no error #14
Open
Description
In the example:
class SomeClass(object):
def some_method(self):
return self.no_such_attr
def some_other_method(self):
return self.no_such_method()
There is no error on line 3 nor on line 6 but running this code will raise AttributeError(s).
I can imagine that if the class is subclassing other object, checking recursively if the method or attribute is defined is too expensive.
One could argue that these problems should be dealt with using other tools (unittest, doctest).
In any case, I'm leaving the issue here for evaluation.
Metadata
Metadata
Assignees
Labels
No labels