List of commits:
Subject Hash Author Date (UTC)
Improve the documentation for template strings (#856) 9f74deba784fc8781d13ed564f69c02ed7c331bb Barry Warsaw 2017-03-28 14:02:07
bpo-29643: Fix check for --enable-optimizations (GH-129) 8cea5929f52801b0ce5928b46ef836e99a24321a Alex Wang 2017-03-28 12:50:51
Drop the standard gcc test build on Travis (GH-853) ad2f9e2c8a0b44b3e6aec9d28ba59e13239236f7 Brett Cannon 2017-03-27 23:39:54
Fix ref cycles in TestCase.assertRaises() (#193) bbd3cf8f1ef1e91a8d6dac6411e18b4b9084abf5 Victor Stinner 2017-03-27 22:56:28
bpo-29677: DOC: clarify documentation for `round` (#357) 6003db7db5fec545c01923c198a5fdfca5a91538 Gerrit Holl 2017-03-27 22:15:20
bpo-29924: Remove useless argument (#854) d67a103702cf57de90a62c90f7ae969c23d96218 Sylvain 2017-03-27 21:36:08
bpo-29912: Remove redundant tests in list_tests that are found in seq_tests (GH-847) d702c50049207d825c1d5925fbc7306514fa9a0a Jim Fasarakis-Hilliard 2017-03-27 19:35:52
bpo-29919: Remove unused imports found by pyflakes (#137) d6debb24e06152a827769b0cac24c47deccdeac1 Victor Stinner 2017-03-27 14:05:26
bpo-20552: Use specific asserts in bytes tests (#790) 604e74c6beb2585c81083fa85f0e5a4d46965cbc Serhiy Storchaka 2017-03-27 10:59:07
Minor test cleanup (GH-837) b8a7daf077dab18e9e3701c5380b542ae0aa9a94 Zachary Ware 2017-03-27 05:08:31
Treat Sphinx warnings as errors (GH-832) 334e9ec938ea9876baadef15edb135d6d2aff30c Zachary Ware 2017-03-27 02:31:31
import sys before we use it on line 9 (#828) 0579e81f30d00da562f021760d5b6a9c35186520 Jelle Zijlstra 2017-03-27 02:17:39
Fixes sphinx warning in "changelog" misc/NEWS (#829) 5fb278fd58688177a113755e1996cd4c9706477c Michael Seifert 2017-03-27 01:25:57
Fix small exception typos in Lib (#818) 1e73dbbc29c96d0739ffef92db36f63aa1aa30da Jim Fasarakis-Hilliard 2017-03-26 20:59:08
bpo-29888: Fix the link referring to the "Python download page" (GH-824) f8beb9831acd5cf80b9c56aea5864e16118c5400 cocoatomo 2017-03-26 17:32:24
bpo-29900: Simplify pathlib implementation. (#814) 62a99515301fa250feba1a2e0f2d8ea2a29d700e Serhiy Storchaka 2017-03-25 11:42:11
bpo-29901: Improve support of path-like objects in zipapp. (#815) 4aec9a8be2f2574f249008eb8be76c070fea37eb Serhiy Storchaka 2017-03-25 11:05:23
Simplify partial.__new__. (#813) 3c749fc867f69deac75f866d5c1ba0f60e54c1fa Serhiy Storchaka 2017-03-25 10:10:16
bpo-29862: Fix grammar in importlib.reload() exception (GH-809) 9f0aa4843f8c26937d5817f27cac4aae9c0a034f Mandeep Bhutani 2017-03-25 04:51:21
bpo-29892: Fix wrong markup on doc-lib-functions (GH-802) 29540cdf6c66df9f806375a95078c0c63192ef78 NAKAMURA Osamu 2017-03-25 02:55:08
Commit 9f74deba784fc8781d13ed564f69c02ed7c331bb - Improve the documentation for template strings (#856)
bpo-19824
bpo-20314
bpo-12518
Author: Barry Warsaw
Author date (UTC): 2017-03-28 14:02
Committer name: GitHub
Committer date (UTC): 2017-03-28 14:02
Parent(s): 8cea5929f52801b0ce5928b46ef836e99a24321a
Signer:
Signing key:
Signing status: N
Tree: ce17bcb189b64ab8b4020ca4b09c0987a2ec5705
File Lines added Lines deleted
Doc/library/stdtypes.rst 5 4
Doc/library/string.rst 19 11
Misc/NEWS 4 0
File Doc/library/stdtypes.rst changed (mode: 100644) (index 9cf876783e..a9877ba666)
... ... expression support in the :mod:`re` module).
2076 2076
2077 2077 The formatting operations described here exhibit a variety of quirks that The formatting operations described here exhibit a variety of quirks that
2078 2078 lead to a number of common errors (such as failing to display tuples and lead to a number of common errors (such as failing to display tuples and
2079 dictionaries correctly). Using the newer :ref:`formatted
2080 string literals <f-strings>` or the :meth:`str.format` interface
2081 helps avoid these errors. These alternatives also provide more powerful,
2082 flexible and extensible approaches to formatting text.
2079 dictionaries correctly). Using the newer :ref:`formatted string literals
2080 <f-strings>`, the :meth:`str.format` interface, or :ref:`template strings
2081 <template-strings>` may help avoid these errors. Each of these
2082 alternatives provides their own trade-offs and benefits of simplicity,
2083 flexibility, and/or extensibility.
2083 2084
2084 2085 String objects have one unique built-in operation: the ``%`` operator (modulo). String objects have one unique built-in operation: the ``%`` operator (modulo).
2085 2086 This is also known as the string *formatting* or *interpolation* operator. This is also known as the string *formatting* or *interpolation* operator.
File Doc/library/string.rst changed (mode: 100644) (index 03eaf3b9cd..8176a81d4c)
... ... Nesting arguments and more complex examples::
657 657 Template strings Template strings
658 658 ---------------- ----------------
659 659
660 Templates provide simpler string substitutions as described in :pep:`292`.
661 Instead of the normal ``%``\ -based substitutions, Templates support ``$``\
662 -based substitutions, using the following rules:
660 Template strings provide simpler string substitutions as described in
661 :pep:`292`. A primary use case for template strings is for
662 internationalization (i18n) since in that context, the simpler syntax and
663 functionality makes it easier to translate than other built-in string
664 formatting facilities in Python. As an example of a library built on template
665 strings for i18n, see the
666 `flufl.i18n <http://flufli18n.readthedocs.io/en/latest/>`_ package.
667
668 Template strings support ``$``-based substitutions, using the following rules:
663 669
664 670 * ``$$`` is an escape; it is replaced with a single ``$``. * ``$$`` is an escape; it is replaced with a single ``$``.
665 671
 
... ... Here is an example of how to use a Template::
735 741 >>> Template('$who likes $what').safe_substitute(d) >>> Template('$who likes $what').safe_substitute(d)
736 742 'tim likes $what' 'tim likes $what'
737 743
738 Advanced usage: you can derive subclasses of :class:`Template` to customize the
739 placeholder syntax, delimiter character, or the entire regular expression used
740 to parse template strings. To do this, you can override these class attributes:
744 Advanced usage: you can derive subclasses of :class:`Template` to customize
745 the placeholder syntax, delimiter character, or the entire regular expression
746 used to parse template strings. To do this, you can override these class
747 attributes:
741 748
742 * *delimiter* -- This is the literal string describing a placeholder introducing
743 delimiter. The default value is ``$``. Note that this should *not* be a
744 regular expression, as the implementation will call :meth:`re.escape` on this
745 string as needed.
749 * *delimiter* -- This is the literal string describing a placeholder
750 introducing delimiter. The default value is ``$``. Note that this should
751 *not* be a regular expression, as the implementation will call
752 :meth:`re.escape` on this string as needed. Note further that you cannot
753 change the delimiter after class creation (i.e. a different delimiter must
754 be set in the subclass's class namespace).
746 755
747 756 * *idpattern* -- This is the regular expression describing the pattern for * *idpattern* -- This is the regular expression describing the pattern for
748 757 non-braced placeholders (the braces will be added automatically as non-braced placeholders (the braces will be added automatically as
 
... ... Helper functions
787 796 or ``None``, runs of whitespace characters are replaced by a single space or ``None``, runs of whitespace characters are replaced by a single space
788 797 and leading and trailing whitespace are removed, otherwise *sep* is used to and leading and trailing whitespace are removed, otherwise *sep* is used to
789 798 split and join the words. split and join the words.
790
File Misc/NEWS changed (mode: 100644) (index b41fd8d79f..9ff9481fd1)
... ... C API
879 879 Documentation Documentation
880 880 ------------- -------------
881 881
882 - bpo-19824, bpo-20314, bpo-12518: Improve the documentation for, and links
883 to, template strings by emphasizing their utility for internationalization,
884 and by clarifying some usage constraints.
885
882 886 - bpo-28929: Link the documentation to its source file on GitHub. - bpo-28929: Link the documentation to its source file on GitHub.
883 887
884 888 - bpo-25008: Document smtpd.py as effectively deprecated and add a pointer to - bpo-25008: Document smtpd.py as effectively deprecated and add a pointer to
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using git:
git clone git://git.rocketgit.com/user/benf_wspdigital/cpython

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main