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/2010-November/105153.html below:

[Python-Dev] okay to remove argparse.__all__?

[Python-Dev] okay to remove argparse.__all__? [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

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