Python Forum
what if __getattr__() can't find an attribute, either?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what if __getattr__() can't find an attribute, either?
#2
https://docs.python.org/3/reference/data..._getattr__ Wrote:object.__getattr__(self, name)
Called when the default attribute access fails with an AttributeError (either __getattribute__() raises an AttributeError because name is not an instance attribute or an attribute in the class tree for self; or __get__() of a name property raises AttributeError). This method should either return the (computed) attribute value or raise an AttributeError exception.
Skaperen likes this post
Reply


Messages In This Thread
RE: what if __getattr__() can't find an attribute, either? - by Yoriz - Oct-08-2021, 08:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting 'NoneType' object has no attribute 'find' error when WebScraping with BS Franky77 2 5,322 Aug-17-2021, 05:24 PM
Last Post: Franky77
  @property vs __set__ / __get__ and __setattr__ / __getattr__ okhajut 1 3,380 Jun-15-2021, 03:48 PM
Last Post: snippsat
  Object cannot find its attribute colt 6 3,522 Oct-09-2019, 12:30 AM
Last Post: ichabod801
  __getattr__ and type hint itaybardugo 0 2,667 Jul-04-2019, 09:50 PM
Last Post: itaybardugo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020