Hacker News new | past | comments | ask | show | jobs | submit login

> For example, if we define the __add__() special method on an existing class, it will set the nb_add slot of the class to the default implementation that calls the method.

See also this post from 2014, which argues that this is a bad design. It claims that Python would be both simpler and faster if it looked up special methods like `__add__` by name every time, rather than using the slot mechanism:

https://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-t...




There's a great on this by the same author: https://www.youtube.com/watch?v=qCGofLIzX6g




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: