I have the following problem:
self.myWrapper = wrapper.Wrapper
self.myWrapper.set_entities(self.myWrapper, self.testEntity)
produces an error message, so does
self.myWrapper = wrapper.Wrapper
self.myWrapper.set_entities(self.myWrapper, self.testEntity)
The error message is:
TypeError: unbound method set_entities() must be called with Wrapper
instance as first argument (got type instance instance instead)
What is wrong here? Where is the difference ob an object instance and a type instance?
Assuming
wrapper.Wrapperis a class, you need to actually initialize an instance.Note the parenthesis. Also, note this isn’t a problem of getter/setter calling (though you should read up a bit more on Python if you are using the getter/setter pattern for member attributes, as it’s not recommended in most cases in Python), but rather a problem of instance vs class and attribute access.