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
970d1887
Kaydet (Commit)
970d1887
authored
Eki 02, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add a test and a note about metaclasses now being abcs
üst
5397e862
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
test_abc.py
Lib/test/test_abc.py
+13
-0
NEWS
Misc/NEWS
+3
-2
No files found.
Lib/test/test_abc.py
Dosyayı görüntüle @
970d1887
...
@@ -105,6 +105,19 @@ class TestABC(unittest.TestCase):
...
@@ -105,6 +105,19 @@ class TestABC(unittest.TestCase):
pass
pass
self
.
assertRaises
(
AttributeError
,
getattr
,
meta
,
"__abstractmethods__"
)
self
.
assertRaises
(
AttributeError
,
getattr
,
meta
,
"__abstractmethods__"
)
def
test_metaclass_abc
(
self
):
# Metaclasses can be ABCs, too.
class
A
(
metaclass
=
abc
.
ABCMeta
):
@abc.abstractmethod
def
x
(
self
):
pass
self
.
assertEqual
(
A
.
__abstractmethods__
,
{
"x"
})
class
meta
(
type
,
A
):
def
x
(
self
):
return
1
class
C
(
metaclass
=
meta
):
pass
def
test_registration_basics
(
self
):
def
test_registration_basics
(
self
):
class
A
(
metaclass
=
abc
.
ABCMeta
):
class
A
(
metaclass
=
abc
.
ABCMeta
):
pass
pass
...
...
Misc/NEWS
Dosyayı görüntüle @
970d1887
...
@@ -10,14 +10,15 @@ What's New in Python 3.2 Alpha 3?
...
@@ -10,14 +10,15 @@ What's New in Python 3.2 Alpha 3?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
result metaclasses can now be ABCs (see #9533).
- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE
UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE
and 32 bits wchar_t (eg. Linux in narrow build).
and 32 bits wchar_t (eg. Linux in narrow build).
- Issue #10006: type.__abstractmethods__ now raises an AttributeError.
- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
introduced by issue #9324.
introduced by issue #9324.
...
...
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