Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Class method invocations without being defined raise no error #14

Open
unode opened this issue Mar 15, 2011 · 1 comment
Open

Class method invocations without being defined raise no error #14

unode opened this issue Mar 15, 2011 · 1 comment

Comments

@unode
Copy link

unode commented Mar 15, 2011

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.

@saper
Copy link
Contributor

saper commented Jan 6, 2013

I think that tracing object instance slots is just not implemented.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants