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
f609654b
Kaydet (Commit)
f609654b
authored
Kas 17, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
handle dict subclasses gracefully in PyArg_ValidateKeywordArguments
üst
12ae290b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
test_dict.py
Lib/test/test_dict.py
+7
-4
NEWS
Misc/NEWS
+5
-0
dictobject.c
Objects/dictobject.c
+1
-1
getargs.c
Python/getargs.c
+1
-1
No files found.
Lib/test/test_dict.py
Dosyayı görüntüle @
f609654b
...
@@ -8,10 +8,13 @@ import gc, weakref
...
@@ -8,10 +8,13 @@ import gc, weakref
class
DictTest
(
unittest
.
TestCase
):
class
DictTest
(
unittest
.
TestCase
):
def
test_invalid_keyword_arguments
(
self
):
def
test_invalid_keyword_arguments
(
self
):
with
self
.
assertRaises
(
TypeError
):
class
Custom
(
dict
):
dict
(
**
{
1
:
2
})
pass
with
self
.
assertRaises
(
TypeError
):
for
invalid
in
{
1
:
2
},
Custom
({
1
:
2
}):
{}
.
update
(
**
{
1
:
2
})
with
self
.
assertRaises
(
TypeError
):
dict
(
**
invalid
)
with
self
.
assertRaises
(
TypeError
):
{}
.
update
(
**
invalid
)
def
test_constructor
(
self
):
def
test_constructor
(
self
):
# calling built-in types without argument must return empty
# calling built-in types without argument must return empty
...
...
Misc/NEWS
Dosyayı görüntüle @
f609654b
...
@@ -26,6 +26,11 @@ Library
...
@@ -26,6 +26,11 @@ Library
- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects,
- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects,
rather than strings.
rather than strings.
C-API
-----
- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
What's New in Python 3.2 Alpha 4?
What's New in Python 3.2 Alpha 4?
=================================
=================================
...
...
Objects/dictobject.c
Dosyayı görüntüle @
f609654b
...
@@ -454,7 +454,7 @@ _PyDict_HasOnlyStringKeys(PyObject *dict)
...
@@ -454,7 +454,7 @@ _PyDict_HasOnlyStringKeys(PyObject *dict)
{
{
Py_ssize_t
pos
=
0
;
Py_ssize_t
pos
=
0
;
PyObject
*
key
,
*
value
;
PyObject
*
key
,
*
value
;
assert
(
PyDict_Check
Exact
(
dict
));
assert
(
PyDict_Check
(
dict
));
/* Shortcut */
/* Shortcut */
if
(((
PyDictObject
*
)
dict
)
->
ma_lookup
==
lookdict_unicode
)
if
(((
PyDictObject
*
)
dict
)
->
ma_lookup
==
lookdict_unicode
)
return
1
;
return
1
;
...
...
Python/getargs.c
Dosyayı görüntüle @
f609654b
...
@@ -1394,7 +1394,7 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args,
...
@@ -1394,7 +1394,7 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args,
int
int
PyArg_ValidateKeywordArguments
(
PyObject
*
kwargs
)
PyArg_ValidateKeywordArguments
(
PyObject
*
kwargs
)
{
{
if
(
!
PyDict_Check
Exact
(
kwargs
))
{
if
(
!
PyDict_Check
(
kwargs
))
{
PyErr_BadInternalCall
();
PyErr_BadInternalCall
();
return
0
;
return
0
;
}
}
...
...
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