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
2c05a2e0
Kaydet (Commit)
2c05a2e0
authored
Eki 31, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
do safety checks on __qualname__ assignment
üst
8afa7fa5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
test_descr.py
Lib/test/test_descr.py
+8
-0
NEWS
Misc/NEWS
+3
-0
typeobject.c
Objects/typeobject.c
+2
-0
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
2c05a2e0
...
...
@@ -4502,6 +4502,14 @@ order (MRO) for bases """
self
.
assertEqual
(
float
.
real
.
__qualname__
,
'float.real'
)
self
.
assertEqual
(
int
.
__add__
.
__qualname__
,
'int.__add__'
)
class
X
:
pass
with
self
.
assertRaises
(
TypeError
):
del
X
.
__qualname__
self
.
assertRaises
(
TypeError
,
type
.
__dict__
[
'__qualname__'
]
.
__set__
,
str
,
'Oink'
)
def
test_qualname_dict
(
self
):
ns
=
{
'__qualname__'
:
'some.name'
}
tp
=
type
(
'Foo'
,
(),
ns
)
...
...
Misc/NEWS
Dosyayı görüntüle @
2c05a2e0
...
...
@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
Core and Builtins
-----------------
- Fix segfaults on setting __qualname__ on builtin types and attempting to
delete it on any type.
- Issue #16271: Fix strange bugs that resulted from __qualname__ appearing in a
class'
s
__dict__
and
on
type
.
...
...
Objects/typeobject.c
Dosyayı görüntüle @
2c05a2e0
...
...
@@ -311,6 +311,8 @@ type_set_qualname(PyTypeObject *type, PyObject *value, void *context)
{
PyHeapTypeObject
*
et
;
if
(
!
check_set_special_type_attr
(
type
,
value
,
"__qualname__"
))
return
-
1
;
if
(
!
PyUnicode_Check
(
value
))
{
PyErr_Format
(
PyExc_TypeError
,
"can only assign string to %s.__qualname__, not '%s'"
,
...
...
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