A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-July/112496.html below:

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

[Python-Dev] Convention on functions that shadow existing stdlib functions [Python-Dev] Convention on functions that shadow existing stdlib functionsEli Bendersky eliben at gmail.com
Sun Jul 24 05:35:56 CEST 2011
Some background: I'm working (on and off) on issue 11015 - documenting
the public functions in test.support

Some of the functions in test.support (for example unlink, rmtree)
simply shadow existing & popular stdlib functions, with the aim of
swallowing the exceptions these may throw. This is confusing, IMHO.
For example, grepping 'unlink' on Lib/test/test_*.py files doesn't say
much about which unlink is being used.

A couple of options to handle this are:

1. Remove these functions altogether, trying to use existing
constructs (such as the ignore_errors parameter in rmtree).
2. Adapt a naming convention for such functions, for instance
rmtree_silent and unlink_silent (or a similar convention, if one
exists)

Opinions?

Eli
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4