diff options
author | Georg Brandl <georg@python.org> | 2012-03-10 08:27:30 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-03-10 08:27:30 (GMT) |
commit | 6aacc14e2926ad96760822d4ff3a711bee3ba181 (patch) | |
tree | 1a9e9a78d395ec4319c09ae8c70240d759e1e258 | |
parent | ba108823b62a2eb3d5f6f067140ccebf6fee84bb (diff) | |
parent | e144c74e023b9caccd0a23ff718028cdd376cddd (diff) | |
download | cpython-6aacc14e2926ad96760822d4ff3a711bee3ba181.zip cpython-6aacc14e2926ad96760822d4ff3a711bee3ba181.tar.gz cpython-6aacc14e2926ad96760822d4ff3a711bee3ba181.tar.bz2 |
Merge with 3.2.
-rw-r--r-- | Doc/reference/compound_stmts.rst | 5 | ||||
-rw-r--r-- | Lib/re.py | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index aea08e0..4ce7324 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -535,6 +535,11 @@ returned or passed around. Free variables used in the nested function can access the local variables of the function containing the def. See section :ref:`naming` for details. +.. seealso:: + + :pep:`3107` - Function Annotations + The original specification for function annotations. + .. _class: @@ -179,14 +179,19 @@ def subn(pattern, repl, string, count=0, flags=0): def split(pattern, string, maxsplit=0, flags=0): """Split the source string by the occurrences of the pattern, - returning a list containing the resulting substrings.""" + returning a list containing the resulting substrings. If + capturing parentheses are used in pattern, then the text of all + groups in the pattern are also returned as part of the resulting + list. If maxsplit is nonzero, at most maxsplit splits occur, + and the remainder of the string is returned as the final element + of the list.""" return _compile(pattern, flags).split(string, maxsplit) def findall(pattern, string, flags=0): """Return a list of all non-overlapping matches in the string. - If one or more groups are present in the pattern, return a - list of groups; this will be a list of tuples if the pattern + If one or more capturing groups are present in the pattern, return + a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result.""" |