Alex <[email protected]> added the comment:
Hi, I've taken a look at these suggestions and the documentation and I've posted a patch to get things moving :) A couple of points about the suggested changes that I haven't included in the patch: 1) I think changing the documentation for __dir__() to say it can return an iterable needs some discussion. The documentation also says: "The ``__dir__`` function should accept no arguments, and return a list of strings that represents the names accessible on module. If present, this function overrides the standard :func:`dir` search on a module." And this should definitely be updated from "list of strings" to either "sequence of strings" or "iterable of strings". However, I'm not sure about updating docs to include "accidental" functionality - looking at the testing, news, and documentation from commit https://github.com/python/cpython/commit/3bbb72265411585e64a5d2ccb5ba51763f20e311 the intention was to allow __dir__ to return a sequence. I think updating the docs to say __dir__ should return an iterator would be a separate issue which would also include test enchancements, so I've left that change out of my patch and I've just corrected the line I've quoted above. 2) > The docs still say that the ABCs are in `collections` rather than `collections.abc`. I couldn't find an instance of this, it's probably been corrected at some point. Any thoughts on the above, the other suggestions, or the patch? ---------- keywords: +patch nosy: +alclarks Added file: https://bugs.python.org/file48713/issue25866.v1.patch _______________________________________ Python tracker <[email protected]> <https://bugs.python.org/issue25866> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
