[issue45154] Enumerate() function or class?

Raymond Hettinger report at bugs.python.org
Thu Sep 9 12:31:34 EDT 2021


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

In pure python, generators are implemented as functions.  In CPython, the only way to implement them is as a class.  From a user's point of view, enumerate(), map(), zip(), and filter() are used like a functions (they doesn't have non-dunder methods).  Accordingly, they don't have class markup in the docs even though technically they are classes.  The docs are mostly consistent in this regard and have opted for the presentation that tends to be the most helpful to users.

----------
assignee: docs at python -> rhettinger
nosy: +rhettinger
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45154>
_______________________________________


More information about the Python-bugs-list mailing list