Commit Graph

142 Commits

Author SHA1 Message Date
Serhiy Storchaka
87be28f4a1 bpo-31672: Restore the former behavior when override flags in Template. (#5099)
Overriding flags to 0 will make the default pattern matching only
lower case letters.
2018-01-04 19:20:11 +02:00
Barry Warsaw
e256b40888 bpo-31672 - Add one last minor clarification for idpattern (#4483)
Add one last minor clarification for idpattern
2017-11-21 10:28:13 -05:00
INADA Naoki
b22273ec5d bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872)
Pattern `[a-z]` with `IGNORECASE` flag can match to some non-ASCII characters.

Straightforward solution for this is using `IGNORECASE | ASCII` flag.
But users may subclass `Template` and override only `idpattern`. So we want to
avoid changing `Template.flags`.

So this commit uses local flag `-i` for `idpattern` and change `[a-z]` to `[a-zA-Z]`.
2017-10-13 16:02:23 +09:00
Barry Warsaw
ba4279683f bpo-1198569: Allow string.Template braced pattern to be different (#3288)
* bpo-1198569: Allow the braced pattern to be different

``string.Template`` subclasses can optionally define ``braceidpattern`` if
they want to specify different placeholder patterns inside and outside the
braces.  If None (the default) it falls back to ``idpattern``.
2017-09-04 16:32:10 -04:00
Serhiy Storchaka
009b0a1fac Issue #29193: A format string argument for string.Formatter.format()
is now positional-only.
2017-01-13 09:10:51 +02:00
R David Murray
44b548dda8 #27364: fix "incorrect" uses of escape character in the stdlib.
And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
2016-09-08 13:59:53 -04:00
Zachary Ware
8bc9378c98 Closes #26809: Merge with 3.5 2016-06-04 14:41:42 -05:00
Zachary Ware
c17a0b87a6 Issue #26809: Add __all__ to string module. Patch by Emanuel Barry 2016-06-04 14:35:05 -05:00
Eric V. Smith
6dcada3bcf Issue #25034: Merge from 3.5. 2015-09-29 10:30:47 -04:00
Eric V. Smith
ad4003c7fb Issue #25034: Merge from 3.4. 2015-09-29 10:30:04 -04:00
Eric V. Smith
85976b14dd Fixed issue #25034: Fix string.Formatter problem with auto-numbering
and nested format_specs. Patch by Anthon van der Neut.
2015-09-29 10:27:38 -04:00
Yury Selivanov
7aa5341164 Reverting my previous commit.
Something went horribly wrong when I was doing `hg rebase`.
2015-05-30 10:57:56 -04:00
Serhiy Storchaka
6e6883f11a Issue #24309: Removed Python 2 idioms. 2015-05-28 20:45:29 +03:00
Serhiy Storchaka
b876df4cbb Issue #23671: string.Template now allows to specify the "self" parameter as
keyword argument.  string.Formatter now allows to specify the "self" and
the "format_string" parameters as keyword arguments.
2015-03-24 22:30:46 +02:00
Serhiy Storchaka
8ffe917cee Issue #23671: string.Template now allows to specify the "self" parameter as
keyword argument.  string.Formatter now allows to specify the "self" and
the "format_string" parameters as keyword arguments.
2015-03-24 22:28:43 +02:00
Eric V. Smith
7ce90743a1 Issue #13598: Add auto-numbering of replacement fields to string.Formatter. 2014-04-14 16:43:50 -04:00
R David Murray
749bd42072 Merge #13579: teach string.Formatter about 'a'.
Patch by Francisco Martín Brugué.
2012-08-19 17:45:40 -04:00
R David Murray
e56bf97ef4 #13579: teach string.Formatter about 'a'.
Patch by Francisco Martín Brugué.
2012-08-19 17:26:34 -04:00
Ezio Melotti
d8b509b192 #13012: use splitlines(keepends=True/False) instead of splitlines(0/1). 2011-09-28 17:37:55 +03:00
Raymond Hettinger
9fe1ccfb5a Issue #11297: Add collections.ChainMap() 2011-02-26 01:02:51 +00:00
Raymond Hettinger
c9423109f5 Factor-out common code for helper classes. 2011-02-22 01:55:36 +00:00
Georg Brandl
66c221e993 #9418: first step of moving private string methods to _string module. 2010-10-14 07:04:07 +00:00
Florent Xicluna
eb19dce085 Issue #1686: Fix string.Template when overriding the pattern attribute. 2010-09-18 23:34:07 +00:00
Florent Xicluna
7b2a7710ef typo 2010-09-06 20:27:55 +00:00
Georg Brandl
056cb93e7a #6630: allow customizing flags for compiling string.Template.idpattern. 2010-07-29 17:16:10 +00:00