Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

__getattribute__ (new classes only!) hijacks the entire lookup machinery; every time you write instance., you will call it.

__getattr__ allows "normal" lookup (is it a method, does it exist in __dict__, etc) to be done by the VM and isn't called until you would otherwise get an AttributeError.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: