seniorPython

Python's Data Model: __getattr__ vs __getattribute__

Updated May 4, 2026

Short answer

Intercepting attribute access at the architecture level.

Deep explanation

__getattr__ is only called if the attribute isn't found via normal means. __getattribute__ is called for EVERY access, making it powerful for building proxies but dangerous due to infinite recursion risks.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Python interview questions

View all →