[Python-Dev] okay to remove argparse.__all__?
Nick Coghlan
ncoghlan at gmail.com
Mon Nov 1 16:10:44 CET 2010
On Tue, Nov 2, 2010 at 12:57 AM, Guido van Rossum <guido at python.org> wrote:
> It is also possible to write automated tests that flag likely missing
> symbols in __all__ (as well as symbols in __all__ missing from the
> module).
These days, test___all__ checks that everything in __all__ exists in
standard library modules. It is also possible for individual module
tests to include a check that goes the other way along the lines of:
def test_all_is_complete():
known_private = {"known", "unexported", "names"}
expected_public = (k for k in mod.__dict__ if k not in known_private
and not k.startswith("_"))
self.assertEqual(set(mod.__all__), expected_public)
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list