Issue #24254: Drop cls.__definition_order__.

This commit is contained in:
Eric Snow 2016-09-08 15:11:11 -07:00
parent 7f730cf01d
commit 4f29e75289
16 changed files with 193 additions and 533 deletions

View file

@ -180,7 +180,7 @@ Use a metaclass that doesn't derive from type.
meta: C ()
ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 42), ('b', 24)]
kw: []
>>> type(C) is types._DefaultClassNamespaceType
>>> type(C) is dict
True
>>> print(sorted(C.items()))
[('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 42), ('b', 24)]
@ -211,11 +211,8 @@ And again, with a __prepare__ attribute.
The default metaclass must define a __prepare__() method.
>>> ns = type.__prepare__()
>>> type(ns) is types._DefaultClassNamespaceType
True
>>> list(ns) == []
True
>>> type.__prepare__()
{}
>>>
Make sure it works with subclassing.
@ -251,9 +248,7 @@ Test failures in looking up the __prepare__ method work.
"""
from collections import OrderedDict
import sys
import types
# Trace function introduces __locals__ which causes various tests to fail.
if hasattr(sys, 'gettrace') and sys.gettrace():