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
c12469df
Kaydet (Commit)
c12469df
authored
Tem 18, 2011
tarafından
Eric V. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge from 3.2.
üst
677b6530
12ebefc9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
0 deletions
+20
-0
test_unicode.py
Lib/test/test_unicode.py
+5
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+4
-0
string_format.h
Objects/stringlib/string_format.h
+10
-0
No files found.
Lib/test/test_unicode.py
Dosyayı görüntüle @
c12469df
...
...
@@ -736,6 +736,11 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertRaises
(
TypeError
,
'{a'
.
format_map
)
self
.
assertRaises
(
TypeError
,
'}a'
.
format_map
)
# issue #12579: can't supply positional params to format_map
self
.
assertRaises
(
ValueError
,
'{}'
.
format_map
,
{
'a'
:
2
})
self
.
assertRaises
(
ValueError
,
'{}'
.
format_map
,
'a'
)
self
.
assertRaises
(
ValueError
,
'{a} {}'
.
format_map
,
{
"a"
:
2
,
"b"
:
1
})
def
test_format_auto_numbering
(
self
):
class
C
:
def
__init__
(
self
,
x
=
100
):
...
...
Misc/ACKS
Dosyayı görüntüle @
c12469df
...
...
@@ -82,6 +82,7 @@ Eli Bendersky
Andrew Bennetts
Andy Bensky
Michel Van den Bergh
Julian Berman
Eric Beser
Steven Bethard
Stephen Bevan
...
...
Misc/NEWS
Dosyayı görüntüle @
c12469df
...
...
@@ -10,6 +10,10 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
- Issue #12579: str.format_map() now raises a ValueError if used on a
format string that contains positional fields. Initial patch by
Julian Berman.
- Issue #10271: Allow warnings.showwarning() be any callable.
- Issue #11627: Fix segfault when __new__ on a exception returns a non-exception
...
...
Objects/stringlib/string_format.h
Dosyayı görüntüle @
c12469df
...
...
@@ -511,6 +511,16 @@ get_field_object(SubString *input, PyObject *args, PyObject *kwargs,
Py_DECREF
(
key
);
}
else
{
/* If args is NULL, we have a format string with a positional field
with only kwargs to retrieve it from. This can only happen when
used with format_map(), where positional arguments are not
allowed. */
if
(
args
==
NULL
)
{
PyErr_SetString
(
PyExc_ValueError
,
"Format string contains "
"positional fields"
);
goto
error
;
}
/* look up in args */
obj
=
PySequence_GetItem
(
args
,
index
);
if
(
obj
==
NULL
)
...
...
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