New submission from Michal Kononenko <michalkonone...@gmail.com>:
The link below defines __len__ https://docs.python.org/3/reference/datamodel.html?highlight=__len__#object.__len__ However, I was reading in the StackOverflow thread below that CPython does some validation to check that the return value of __len__ should be >= 0. Does this mean that len must return a value >= 0, in the RFC 2119 sense of the word? https://stackoverflow.com/questions/42521449/how-does-python-ensure-the-return-value-of-len-is-an-integer-when-len-is-cal ---------- assignee: docs@python components: Documentation messages: 340844 nosy: Michal Kononenko, docs@python priority: normal severity: normal status: open title: Correct Should to Must in Definition of object.__len__ type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36720> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com