[Python-checkins] cpython (2.7): Issue #23504: Added an __all__ to the types module.

serhiy.storchaka python-checkins at python.org
Wed Mar 4 08:45:21 CET 2015


https://hg.python.org/cpython/rev/cb5fe8cc60eb
changeset:   94843:cb5fe8cc60eb
branch:      2.7
parent:      94830:3019effc44f2
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Mar 04 09:42:59 2015 +0200
summary:
  Issue #23504: Added an __all__ to the types module.

files:
  Lib/types.py |  2 ++
  Misc/NEWS    |  2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Lib/types.py b/Lib/types.py
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -82,3 +82,5 @@
 MemberDescriptorType = type(FunctionType.func_globals)
 
 del sys, _f, _g, _C, _x                           # Not for export
+
+__all__ = list(n for n in globals() if n[:1] != '_')
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -18,6 +18,8 @@
 Library
 -------
 
+- Issue #23504: Added an __all__ to the types module.
+
 - Issue #23458: On POSIX, the file descriptor kept open by os.urandom() is now
   set to non inheritable
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list