This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alclarks
Recipients abarnert, alclarks, docs@python, ezio.melotti
Date 2019-11-13.16:42:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573663356.79.0.79298917535.issue25866@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2019-11-13 16:42:36alclarkssetrecipients: + alclarks, ezio.melotti, docs@python, abarnert
2019-11-13 16:42:36alclarkssetmessageid: <1573663356.79.0.79298917535.issue25866@roundup.psfhosted.org>
2019-11-13 16:42:36alclarkslinkissue25866 messages
2019-11-13 16:42:36alclarkscreate