Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8727587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:27:38+00:00 2026-06-13T08:27:38+00:00

In addition to bypassing any instance attributes in the interest of correctness, implicit special

  • 0

In addition to bypassing any instance attributes in the interest of correctness, implicit special method lookup generally also bypasses the __getattribute__() method even of the object’s metaclass.

The docs mention special methods such as __hash__, __repr__ and __len__, and I know from experience it also includes __iter__ for Python 2.7.

To quote an answer to a related question:

“Magic __methods__() are treated specially: They are internally assigned to “slots” in the type data structure to speed up their look-up, and they are only looked up in these slots.”

In a quest to improve my answer to another question, I need to know: Which methods, specifically, are we talking about?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:27:39+00:00Added an answer on June 13, 2026 at 8:27 am

    You can find an answer in the python3 documentation for object.__getattribute__, which states:

    Called unconditionally to implement attribute accesses for instances of the class. If the class also defines __getattr__(), the
    latter will not be called unless __getattribute__() either calls it
    explicitly or raises an AttributeError. This method should return the
    (computed) attribute value or raise an AttributeError exception. In
    order to avoid infinite recursion in this method, its implementation
    should always call the base class method with the same name to access
    any attributes it needs, for example, object.__getattribute__(self,
    name)
    .

    Note

    This method may still be bypassed when looking up special methods as the result of implicit invocation via language syntax or built-in
    functions. See Special method lookup.

    also this page explains exactly how this “machinery” works. Fundamentally __getattribute__ is called only when you access an attribute with the .(dot) operator(and also by hasattr as Zagorulkin pointed out).

    Note that the page does not specify which special methods are implicitly looked up, so I deem that this hold for all of them(which you may find here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In addition, are there any performance advantages to static methods over instance methods? I
In addition to the datastore for your specific site, can you also share one
NuGet is just great addition for Visual Studio. And it also allows for custom
In addition to the key_name I generate, I also would like to have some
In addition to all the defined api routes, I want to handle any other
In addition to my previous question , another problem appeared and I decided to
Is addition(+) operation more complex than comparison operation (>), both in integer as well
In addition to this question: iPhone network performance , I would like to know
In addition to jquery plugin options, I want to override those values with html5
Dummy code: public object Addition(object a, object b) { var type = a.GetType(); var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.