syntax oddities

Ian Kelly ian.g.kelly at gmail.com
Tue May 15 16:27:09 EDT 2018


On Tue, May 15, 2018 at 1:10 PM, Tobiah <toby at tobiah.org> wrote:
> Why is it len(object) instead of object.len?
>
> Why is it getattr(object, item) rather then object.getattr(item)?

http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm



More information about the Python-list mailing list