Staging
v0.5.1
https://github.com/python/cpython
Revision 19d246745d9d013c12e9560dd020d778381780fb authored by Nick Coghlan on 05 December 2016, 06:47:55 UTC, committed by Nick Coghlan on 05 December 2016, 06:47:55 UTC
Handling zero-argument super() in __init_subclass__ and
__set_name__ involved moving __class__ initialisation to
type.__new__. This requires cooperation from custom
metaclasses to ensure that the new __classcell__ entry
is passed along appropriately.

The initial implementation of that change resulted in abruptly
broken zero-argument super() support in metaclasses that didn't
adhere to the new requirements (such as Django's metaclass for
Model definitions).

The updated approach adopted here instead emits a deprecation
warning for those cases, and makes them work the same way they
did in Python 3.5.

This patch also improves the related class machinery documentation
to cover these details and to include more reader-friendly
cross-references and index entries.
1 parent 71c62e1
History
Tip revision: 19d246745d9d013c12e9560dd020d778381780fb authored by Nick Coghlan on 05 December 2016, 06:47:55 UTC
Issue #23722: improve __classcell__ compatibility
Tip revision: 19d2467
File Mode Size
Python-ast.h -rw-r--r-- 21.8 KB
Python.h -rw-r--r-- 2.9 KB
abstract.h -rw-r--r-- 46.1 KB
accu.h -rw-r--r-- 1016 bytes
asdl.h -rw-r--r-- 1.2 KB
ast.h -rw-r--r-- 477 bytes
bitset.h -rw-r--r-- 792 bytes
bltinmodule.h -rw-r--r-- 264 bytes
boolobject.h -rw-r--r-- 886 bytes
bytearrayobject.h -rw-r--r-- 2.1 KB
bytes_methods.h -rw-r--r-- 3.1 KB
bytesobject.h -rw-r--r-- 8.1 KB
cellobject.h -rw-r--r-- 701 bytes
ceval.h -rw-r--r-- 8.1 KB
classobject.h -rw-r--r-- 1.6 KB
code.h -rw-r--r-- 5.8 KB
codecs.h -rw-r--r-- 6.5 KB
compile.h -rw-r--r-- 2.1 KB
complexobject.h -rw-r--r-- 1.8 KB
datetime.h -rw-r--r-- 9.2 KB
descrobject.h -rw-r--r-- 2.9 KB
dictobject.h -rw-r--r-- 6.8 KB
dtoa.h -rw-r--r-- 458 bytes
dynamic_annotations.h -rw-r--r-- 21.9 KB
enumobject.h -rw-r--r-- 253 bytes
errcode.h -rw-r--r-- 1.5 KB
eval.h -rw-r--r-- 597 bytes
fileobject.h -rw-r--r-- 1.5 KB
fileutils.h -rw-r--r-- 2.4 KB
floatobject.h -rw-r--r-- 4.7 KB
frameobject.h -rw-r--r-- 3.4 KB
funcobject.h -rw-r--r-- 4.0 KB
genobject.h -rw-r--r-- 3.5 KB
graminit.h -rw-r--r-- 1.9 KB
grammar.h -rw-r--r-- 2.0 KB
import.h -rw-r--r-- 3.9 KB
intrcheck.h -rw-r--r-- 513 bytes
iterobject.h -rw-r--r-- 567 bytes
listobject.h -rw-r--r-- 2.8 KB
longintrepr.h -rw-r--r-- 3.7 KB
longobject.h -rw-r--r-- 8.3 KB
marshal.h -rw-r--r-- 803 bytes
memoryobject.h -rw-r--r-- 2.6 KB
metagrammar.h -rw-r--r-- 253 bytes
methodobject.h -rw-r--r-- 3.8 KB
modsupport.h -rw-r--r-- 7.2 KB
moduleobject.h -rw-r--r-- 2.1 KB
namespaceobject.h -rw-r--r-- 349 bytes
node.h -rw-r--r-- 1007 bytes
object.h -rw-r--r-- 39.3 KB
objimpl.h -rw-r--r-- 13.8 KB
odictobject.h -rw-r--r-- 1.3 KB
opcode.h -rw-r--r-- 5.0 KB
osdefs.h -rw-r--r-- 691 bytes
osmodule.h -rw-r--r-- 221 bytes
parsetok.h -rw-r--r-- 2.8 KB
patchlevel.h -rw-r--r-- 1.1 KB
pgen.h -rw-r--r-- 253 bytes
pgenheaders.h -rw-r--r-- 1.2 KB
py_curses.h -rw-r--r-- 4.1 KB
pyarena.h -rw-r--r-- 2.7 KB
pyatomic.h -rw-r--r-- 7.9 KB
pycapsule.h -rw-r--r-- 1.7 KB
pyctype.h -rw-r--r-- 1.3 KB
pydebug.h -rw-r--r-- 1.2 KB
pydtrace.d -rw-r--r-- 863 bytes
pydtrace.h -rw-r--r-- 1.9 KB
pyerrors.h -rw-r--r-- 16.4 KB
pyexpat.h -rw-r--r-- 2.3 KB
pyfpe.h -rw-r--r-- 8.3 KB
pygetopt.h -rw-r--r-- 410 bytes
pyhash.h -rw-r--r-- 4.0 KB
pylifecycle.h -rw-r--r-- 3.9 KB
pymacconfig.h -rw-r--r-- 2.9 KB
pymacro.h -rw-r--r-- 3.4 KB
pymath.h -rw-r--r-- 7.2 KB
pymem.h -rw-r--r-- 8.2 KB
pyport.h -rw-r--r-- 26.9 KB
pystate.h -rw-r--r-- 10.5 KB
pystrcmp.h -rw-r--r-- 436 bytes
pystrhex.h -rw-r--r-- 495 bytes
pystrtod.h -rw-r--r-- 1.4 KB
pythonrun.h -rw-r--r-- 6.6 KB
pythread.h -rw-r--r-- 2.9 KB
pytime.h -rw-r--r-- 6.9 KB
rangeobject.h -rw-r--r-- 629 bytes
setobject.h -rw-r--r-- 3.3 KB
sliceobject.h -rw-r--r-- 1.6 KB
structmember.h -rw-r--r-- 2.0 KB
structseq.h -rw-r--r-- 1.3 KB
symtable.h -rw-r--r-- 4.9 KB
sysmodule.h -rw-r--r-- 1.3 KB
token.h -rw-r--r-- 1.9 KB
traceback.h -rw-r--r-- 3.6 KB
tupleobject.h -rw-r--r-- 2.4 KB
typeslots.h -rw-r--r-- 2.2 KB
ucnhash.h -rw-r--r-- 1.0 KB
unicodeobject.h -rw-r--r-- 79.1 KB
warnings.h -rw-r--r-- 1.6 KB
weakrefobject.h -rw-r--r-- 2.8 KB

back to top