From: Jeff A. <ja...@fa...> - 2017-08-13 21:54:10
|
PyType really is quite hairy code. It has certainly tested my understanding of Java initialisation. I've not changed anything materially yet, but produced a version plastered with print statements that others might find amusing: https://bitbucket.org/tournesol/jython-fgtype/commits/094f87e1ddaa5d30b4d1be9fcf3209e0ff6432bd It produces output like this: addBuilder(class o.p.c.PyShadowString, class o.p.c.PyShadowString$PyExposer) --- --- --- --- fromClass(class o.p.c.PyShadowString, true) -> null | addFromClass(class o.p.c.PyShadowString) | createType(class o.p.c.PyShadowString) | getBuilder(class o.p.c.PyShadowString) | Class.forName(class o.p.c.PyShadowString) with static init. | fromClass(class o.p.c.PyType, false) -> <type 'type'> | PyType.init(class o.p.c.PyShadowString) | fromClass(class o.p.c.PyString, false) -> <type 'str'> | fromClass(class o.p.c.PyMethodDescr, false) -> <type 'method_descriptor'> | fromClass(class o.p.c.PyMethodDescr, false) -> <type 'method_descriptor'> | fromClass(class o.p.c.PyMethodDescr, false) -> <type 'method_descriptor'> | fromClass(class o.p.c.PyMethodDescr, false) -> <type 'method_descriptor'> | fromClass(class o.p.c.PyMethodDescr, false) -> <type 'method_descriptor'> | fromClass(class o.p.c.PyMethodDescr, false) -> <type 'method_descriptor'> | +-- init'd <type 'shadowstr'> (from class o.p.c.PyShadowString) | +-- created <type 'shadowstr'> from class o.p.c.PyShadowString +-> <type 'shadowstr'> (from class o.p.c.PyShadowString) --- --- --- --- There is some odd-but-not-incorrect behaviour amongst the 15000 or so lines, including PyArray initialised twice and _codecs$EncodingMap left in the bootstrap types at the end (until you look up the right kind of codec). Now I understand the logic better, and have a baseline, I'll try the ClassValue idea, and exhibit it in the same place. Jeff |