Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e256b408
Unverified
Kaydet (Commit)
e256b408
authored
Kas 21, 2017
tarafından
Barry Warsaw
Kaydeden (comit)
GitHub
Kas 21, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31672 - Add one last minor clarification for idpattern (#4483)
Add one last minor clarification for idpattern
üst
337cbbac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
string.rst
Doc/library/string.rst
+4
-2
string.py
Lib/string.py
+7
-4
No files found.
Doc/library/string.rst
Dosyayı görüntüle @
e256b408
...
...
@@ -755,13 +755,15 @@ attributes:
* *idpattern* -- This is the regular expression describing the pattern for
non-braced placeholders. The default value is the regular expression
``(?
-i
:[_a-zA-Z][_a-zA-Z0-9]*)``. If this is given and *braceidpattern* is
``(?
a
:[_a-zA-Z][_a-zA-Z0-9]*)``. If this is given and *braceidpattern* is
``None`` this pattern will also apply to braced placeholders.
.. note::
Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match
with some non-ASCII characters. That's why we use local ``-i`` flag here.
with some non-ASCII characters. That's why we use the local ``a`` flag
here. Further, with the default *flags* value, including ``A-Z`` in the
ranges is redundant, but required for backward compatibility.
While *flags* is kept to ``re.IGNORECASE`` for backward compatibility,
you can override it to ``0`` or ``re.IGNORECASE | re.ASCII`` when
...
...
Lib/string.py
Dosyayı görüntüle @
e256b408
...
...
@@ -79,11 +79,14 @@ class Template(metaclass=_TemplateMetaclass):
"""A string class for supporting $-substitutions."""
delimiter
=
'$'
# r'[a-z]' matches to non-ASCII letters when used with IGNORECASE,
# but without ASCII flag. We can't add re.ASCII to flags because of
# backward compatibility. So we use local -i flag and [a-zA-Z] pattern.
# r'[a-z]' matches to non-ASCII letters when used with IGNORECASE, but
# without the ASCII flag. We can't add re.ASCII to flags because of
# backward compatibility. So we use the ?a local flag and [a-z] pattern.
# We also can't remove the A-Z ranges, because although they are
# technically redundant with the IGNORECASE flag, the value is part of the
# publicly documented API.
# See https://bugs.python.org/issue31672
idpattern
=
r'(?
-i
:[_a-zA-Z][_a-zA-Z0-9]*)'
idpattern
=
r'(?
a
:[_a-zA-Z][_a-zA-Z0-9]*)'
braceidpattern
=
None
flags
=
_re
.
IGNORECASE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment