Getattr Getattr Setattr
Table of Contents

getattr(obj, 'foo') is exactly the same thing as

in getattr(self, attribute), you should fetch unavailable attribute (from dict or class.dict) from your extra storage by getattr(, attribute)
in setattr(self, attribute), you can directly access self.dict. for those attributes not available. you can call setattr(, attribute)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License