From: <pj...@us...> - 2009-10-13 02:32:07
|
Revision: 6854 http://jython.svn.sourceforge.net/jython/?rev=6854&view=rev Author: pjenvey Date: 2009-10-13 02:31:45 +0000 (Tue, 13 Oct 2009) Log Message: ----------- move the cached objectGetattribute out of PyObject to ease bootstrapping Modified Paths: -------------- trunk/jython/src/org/python/core/Deriveds.java trunk/jython/src/org/python/core/PyObject.java Modified: trunk/jython/src/org/python/core/Deriveds.java =================================================================== --- trunk/jython/src/org/python/core/Deriveds.java 2009-10-12 05:04:37 UTC (rev 6853) +++ trunk/jython/src/org/python/core/Deriveds.java 2009-10-13 02:31:45 UTC (rev 6854) @@ -6,8 +6,12 @@ */ public class Deriveds { + /** object.__getattribute__ descriptor, cached for use by __findattr_ex__. */ + private static final PyObject objectGetattribute = + PyObject.TYPE.__findattr__("__getattribute__"); + /** - * Derived's __findattr_ex__ implementation. + * Deriveds' __findattr_ex__ implementation. * * This resides here (in org.python.core) because it manipulates PyType, and doesn't * call any of the Derived classes' superclass methods. @@ -34,7 +38,7 @@ type.getName())); } - if (getattribute == PyObject.objectGetattribute) { + if (getattribute == objectGetattribute) { type.setUsesObjectGetattribute(true); } pyName = PyString.fromInterned(name); Modified: trunk/jython/src/org/python/core/PyObject.java =================================================================== --- trunk/jython/src/org/python/core/PyObject.java 2009-10-12 05:04:37 UTC (rev 6853) +++ trunk/jython/src/org/python/core/PyObject.java 2009-10-13 02:31:45 UTC (rev 6854) @@ -38,9 +38,6 @@ /** Primitives classes their wrapper classes. */ private static final Map<Class<?>, Class<?>> primitiveMap = Generic.map(); - /** object.__getattribute__ descriptor, cached for use by Deriveds.__findattr_ex__. */ - static final PyObject objectGetattribute; - static { primitiveMap.put(Character.TYPE, Character.class); primitiveMap.put(Boolean.TYPE, Boolean.class); @@ -55,8 +52,6 @@ Py.writeWarning("init", "Bootstrap types weren't encountered in bootstrapping: " + Py.BOOTSTRAP_TYPES); } - - objectGetattribute = TYPE.__findattr__("__getattribute__"); } public PyObject(PyType objtype) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |