[Python-Dev] Convention on functions that shadow existing stdlib functions

Brett Cannon brett at python.org
Wed Jul 27 19:27:16 CEST 2011


On Wed, Jul 27, 2011 at 06:36, R. David Murray <rdmurray at bitdance.com>wrote:

> On Wed, 27 Jul 2011 16:14:40 +0300, Eli Bendersky <eliben at gmail.com>
> wrote:
> > 1. In the documentation of test.support mention explicitly that it's code
> > for CPython's internal use only, and these APIs aren't guaranteed to be
> > stable.
>
> This was already done.
>
> > 2. Some functions like unlink and rmtree are obviously redundant, and
> shadow
> > frequently used Python stdlib functions, so I would either kill them
> > completely or at least rename them appropriately.
>
> But they aren't redundant, since the test.support versions ignore
> errors.
>
> Perhaps what we could do is move the documentation for test.support to
> the devguide, and then vet the test suite so that unlink and friends
> are always called as 'support.unlink', etc.
>

I like this solution since this issue of documenting test.support keeps
coming up. Otherwise we can not document test.support, but  then we need to
do a pass through the module to make sure  that the docstrings are properly
updated and we start deprecating some of the stuff in there that is just
pure cruft.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110727/6ed45cdd/attachment.html>


More information about the Python-Dev mailing list