http://hg.python.org/peps/rev/93e760149759
changeset: 4328:93e760149759
user: Eric V. Smith <eric(a)trueblade.com>
date: Mon Apr 30 19:28:54 2012 -0400
summary:
Discuss implications on existing finders.
files:
pep-0420.txt | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/pep-0420.txt b/pep-0420.txt
--- a/pep-0420.txt
+++ b/pep-0420.txt
@@ -162,6 +162,10 @@
There is no impact on PEP 302 "loaders".
+If an existing finder is not updated to support returning a string
+from ``find_module``, the only impact is that such a loader will be
+unable to provide portions of a namespace package.
+
Discussion
==========
--
Repository URL: http://hg.python.org/peps
http://hg.python.org/peps/rev/c833ec103ecf
changeset: 4327:c833ec103ecf
user: Eric V. Smith <eric(a)trueblade.com>
date: Mon Apr 30 19:04:39 2012 -0400
summary:
No trailing separators on strings returned by find_module.
files:
pep-0420.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pep-0420.txt b/pep-0420.txt
--- a/pep-0420.txt
+++ b/pep-0420.txt
@@ -157,7 +157,8 @@
"loader" object or None. For a finder to contribute to namespace
packages, ``find_module`` will return a third type: a string. This is
the string that will be recorded and later used as a component of the
-namespace module's __path__, as described above.
+namespace module's ``__path__``, as described above. This string must
+not contain a trailing path separator.
There is no impact on PEP 302 "loaders".
--
Repository URL: http://hg.python.org/peps
http://hg.python.org/peps/rev/02805cdc0604
changeset: 4326:02805cdc0604
user: Eric V. Smith <eric(a)trueblade.com>
date: Mon Apr 30 18:05:25 2012 -0400
summary:
Make it clear that only finders change, not loaders.
files:
pep-0420.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pep-0420.txt b/pep-0420.txt
--- a/pep-0420.txt
+++ b/pep-0420.txt
@@ -159,6 +159,7 @@
the string that will be recorded and later used as a component of the
namespace module's __path__, as described above.
+There is no impact on PEP 302 "loaders".
Discussion
==========
--
Repository URL: http://hg.python.org/peps
http://hg.python.org/cpython/rev/e7d545a5f6bc
changeset: 76674:e7d545a5f6bc
parent: 76671:6e541ed4e987
parent: 76673:5c801899cd6d
user: Ned Deily <nad(a)acm.org>
date: Mon Apr 30 11:15:38 2012 -0700
summary:
Issue #10433: merge
files:
Doc/library/os.rst | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -238,6 +238,20 @@
Availability: Unix.
+ .. note:: On Mac OS X, :func:`getgroups` behavior differs somewhat from
+ other Unix platforms. If the Python interpreter was built with a
+ deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
+ the list of effective group ids associated with the current user process;
+ this list is limited to a system-defined number of entries, typically 16,
+ and may be modified by calls to :func:`setgroups` if suitably privileged.
+ If built with a deployment target greater than :const:`10.5`,
+ :func:`getgroups` returns the current group access list for the user
+ associated with the effective user id of the process; the group access
+ list may change over the lifetime of the process, it is not affected by
+ calls to :func:`setgroups`, and its length is not limited to 16. The
+ deployment target value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be
+ obtained with :func:`sysconfig.get_config_var`.
+
.. function:: initgroups(username, gid)
@@ -425,6 +439,10 @@
Availability: Unix.
+ .. note:: On Mac OS X, the length of *groups* may not exceed the
+ system-defined maximum number of effective group ids, typically 16.
+ See the documentation for :func:`getgroups` for cases where it may not
+ return the same group list set by calling setgroups().
.. function:: setpgrp()
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/5c801899cd6d
changeset: 76673:5c801899cd6d
branch: 3.2
parent: 76670:06046a6943a7
user: Ned Deily <nad(a)acm.org>
date: Mon Apr 30 11:14:02 2012 -0700
summary:
Issue #10433: Document unique behavior of 'os.getgroups' on Mac OS X.
files:
Doc/library/os.rst | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -227,6 +227,20 @@
Availability: Unix.
+ .. note:: On Mac OS X, :func:`getgroups` behavior differs somewhat from
+ other Unix platforms. If the Python interpreter was built with a
+ deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
+ the list of effective group ids associated with the current user process;
+ this list is limited to a system-defined number of entries, typically 16,
+ and may be modified by calls to :func:`setgroups` if suitably privileged.
+ If built with a deployment target greater than :const:`10.5`,
+ :func:`getgroups` returns the current group access list for the user
+ associated with the effective user id of the process; the group access
+ list may change over the lifetime of the process, it is not affected by
+ calls to :func:`setgroups`, and its length is not limited to 16. The
+ deployment target value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be
+ obtained with :func:`sysconfig.get_config_var`.
+
.. function:: initgroups(username, gid)
@@ -389,6 +403,10 @@
Availability: Unix.
+ .. note:: On Mac OS X, the length of *groups* may not exceed the
+ system-defined maximum number of effective group ids, typically 16.
+ See the documentation for :func:`getgroups` for cases where it may not
+ return the same group list set by calling setgroups().
.. function:: setpgrp()
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/2468b58f7fce
changeset: 76672:2468b58f7fce
branch: 2.7
parent: 76669:55b2258c1c7c
user: Ned Deily <nad(a)acm.org>
date: Mon Apr 30 11:13:16 2012 -0700
summary:
Issue #10433: Document unique behavior of 'os.getgroups' on Mac OS X.
files:
Doc/library/os.rst | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -157,6 +157,20 @@
Availability: Unix.
+ .. note:: On Mac OS X, :func:`getgroups` behavior differs somewhat from
+ other Unix platforms. If the Python interpreter was built with a
+ deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
+ the list of effective group ids associated with the current user process;
+ this list is limited to a system-defined number of entries, typically 16,
+ and may be modified by calls to :func:`setgroups` if suitably privileged.
+ If built with a deployment target greater than :const:`10.5`,
+ :func:`getgroups` returns the current group access list for the user
+ associated with the effective user id of the process; the group access
+ list may change over the lifetime of the process, it is not affected by
+ calls to :func:`setgroups`, and its length is not limited to 16. The
+ deployment target value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be
+ obtained with :func:`sysconfig.get_config_var`.
+
.. function:: initgroups(username, gid)
@@ -306,6 +320,10 @@
.. versionadded:: 2.2
+ .. note:: On Mac OS X, the length of *groups* may not exceed the
+ system-defined maximum number of effective group ids, typically 16.
+ See the documentation for :func:`getgroups` for cases where it may not
+ return the same group list set by calling setgroups().
.. function:: setpgrp()
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/6e541ed4e987
changeset: 76671:6e541ed4e987
parent: 76668:910a4b12c796
parent: 76670:06046a6943a7
user: Ezio Melotti <ezio.melotti(a)gmail.com>
date: Mon Apr 30 19:11:11 2012 +0300
summary:
#14558: merge with 3.2.
files:
Doc/library/unittest.rst | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1920,9 +1920,10 @@
testLoader=unittest.defaultTestLoader, exit=True, verbosity=1, \
failfast=None, catchbreak=None, buffer=None, warnings=None)
- A command-line program that runs a set of tests; this is primarily for making
- test modules conveniently executable. The simplest use for this function is to
- include the following line at the end of a test script::
+ A command-line program that loads a set of tests from *module* and runs them;
+ this is primarily for making test modules conveniently executable.
+ The simplest use for this function is to include the following line at the
+ end of a test script::
if __name__ == '__main__':
unittest.main()
@@ -1933,10 +1934,17 @@
if __name__ == '__main__':
unittest.main(verbosity=2)
+ The *argv* argument can be a list of options passed to the program, with the
+ first element being the program name. If not specified or ``None``,
+ the values of :data:`sys.argv` are used.
+
The *testRunner* argument can either be a test runner class or an already
created instance of it. By default ``main`` calls :func:`sys.exit` with
an exit code indicating success or failure of the tests run.
+ The *testLoader* argument has to be a :class:`TestLoader` instance,
+ and defaults to :data:`defaultTestLoader`.
+
``main`` supports being used from the interactive interpreter by passing in the
argument ``exit=False``. This displays the result on standard output without
calling :func:`sys.exit`::
@@ -1944,7 +1952,7 @@
>>> from unittest import main
>>> main(module='test_module', exit=False)
- The ``failfast``, ``catchbreak`` and ``buffer`` parameters have the same
+ The *failfast*, *catchbreak* and *buffer* parameters have the same
effect as the same-name `command-line options`_.
The *warning* argument specifies the :ref:`warning filter <warning-filter>`
@@ -1956,11 +1964,11 @@
This stores the result of the tests run as the ``result`` attribute.
.. versionchanged:: 3.1
- The ``exit`` parameter was added.
+ The *exit* parameter was added.
.. versionchanged:: 3.2
- The ``verbosity``, ``failfast``, ``catchbreak``, ``buffer``
- and ``warnings`` parameters were added.
+ The *verbosity*, *failfast*, *catchbreak*, *buffer*
+ and *warnings* parameters were added.
load_tests Protocol
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/06046a6943a7
changeset: 76670:06046a6943a7
branch: 3.2
parent: 76667:a54b6e321f1c
user: Ezio Melotti <ezio.melotti(a)gmail.com>
date: Mon Apr 30 19:10:28 2012 +0300
summary:
#14558: document the module, argv, and testLoader args of unittest.main.
files:
Doc/library/unittest.rst | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1926,9 +1926,10 @@
testLoader=unittest.defaultTestLoader, exit=True, verbosity=1, \
failfast=None, catchbreak=None, buffer=None, warnings=None)
- A command-line program that runs a set of tests; this is primarily for making
- test modules conveniently executable. The simplest use for this function is to
- include the following line at the end of a test script::
+ A command-line program that loads a set of tests from *module* and runs them;
+ this is primarily for making test modules conveniently executable.
+ The simplest use for this function is to include the following line at the
+ end of a test script::
if __name__ == '__main__':
unittest.main()
@@ -1939,10 +1940,17 @@
if __name__ == '__main__':
unittest.main(verbosity=2)
+ The *argv* argument can be a list of options passed to the program, with the
+ first element being the program name. If not specified or ``None``,
+ the values of :data:`sys.argv` are used.
+
The *testRunner* argument can either be a test runner class or an already
created instance of it. By default ``main`` calls :func:`sys.exit` with
an exit code indicating success or failure of the tests run.
+ The *testLoader* argument has to be a :class:`TestLoader` instance,
+ and defaults to :data:`defaultTestLoader`.
+
``main`` supports being used from the interactive interpreter by passing in the
argument ``exit=False``. This displays the result on standard output without
calling :func:`sys.exit`::
@@ -1950,7 +1958,7 @@
>>> from unittest import main
>>> main(module='test_module', exit=False)
- The ``failfast``, ``catchbreak`` and ``buffer`` parameters have the same
+ The *failfast*, *catchbreak* and *buffer* parameters have the same
effect as the same-name `command-line options`_.
The *warning* argument specifies the :ref:`warning filter <warning-filter>`
@@ -1962,11 +1970,11 @@
This stores the result of the tests run as the ``result`` attribute.
.. versionchanged:: 3.1
- The ``exit`` parameter was added.
+ The *exit* parameter was added.
.. versionchanged:: 3.2
- The ``verbosity``, ``failfast``, ``catchbreak``, ``buffer``
- and ``warnings`` parameters were added.
+ The *verbosity*, *failfast*, *catchbreak*, *buffer*
+ and *warnings* parameters were added.
load_tests Protocol
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/55b2258c1c7c
changeset: 76669:55b2258c1c7c
branch: 2.7
parent: 76630:5bad73fbf593
user: Ezio Melotti <ezio.melotti(a)gmail.com>
date: Mon Apr 30 19:05:57 2012 +0300
summary:
#14558: document the module, argv, and testLoader args of unittest.main.
files:
Doc/library/unittest.rst | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1784,11 +1784,12 @@
stream, descriptions, verbosity
-.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader[, exit[, verbosity[, failfast[, catchbreak[,buffer]]]]]]]]]])
-
- A command-line program that runs a set of tests; this is primarily for making
- test modules conveniently executable. The simplest use for this function is to
- include the following line at the end of a test script::
+.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader[, exit[, verbosity[, failfast[, catchbreak[, buffer]]]]]]]]]])
+
+ A command-line program that loads a set of tests from *module* and runs them;
+ this is primarily for making test modules conveniently executable.
+ The simplest use for this function is to include the following line at the
+ end of a test script::
if __name__ == '__main__':
unittest.main()
@@ -1799,10 +1800,17 @@
if __name__ == '__main__':
unittest.main(verbosity=2)
+ The *argv* argument can be a list of options passed to the program, with the
+ first element being the program name. If not specified or ``None``,
+ the values of :data:`sys.argv` are used.
+
The *testRunner* argument can either be a test runner class or an already
created instance of it. By default ``main`` calls :func:`sys.exit` with
an exit code indicating success or failure of the tests run.
+ The *testLoader* argument has to be a :class:`TestLoader` instance,
+ and defaults to :data:`defaultTestLoader`.
+
``main`` supports being used from the interactive interpreter by passing in the
argument ``exit=False``. This displays the result on standard output without
calling :func:`sys.exit`::
@@ -1810,14 +1818,14 @@
>>> from unittest import main
>>> main(module='test_module', exit=False)
- The ``failfast``, ``catchbreak`` and ``buffer`` parameters have the same
+ The *failfast*, *catchbreak* and *buffer* parameters have the same
effect as the same-name `command-line options`_.
Calling ``main`` actually returns an instance of the ``TestProgram`` class.
This stores the result of the tests run as the ``result`` attribute.
.. versionchanged:: 2.7
- The ``exit``, ``verbosity``, ``failfast``, ``catchbreak`` and ``buffer``
+ The *exit*, *verbosity*, *failfast*, *catchbreak* and *buffer*
parameters were added.
--
Repository URL: http://hg.python.org/cpython