[Jython-checkins] jython: Revert stringmap special case - I need a do-over.
frank.wierzbicki
jython-checkins at python.org
Fri Apr 6 21:51:03 CEST 2012
http://hg.python.org/jython/rev/5a9128b6662b
changeset: 6541:5a9128b6662b
user: Frank Wierzbicki <fwierzbicki at gmail.com>
date: Fri Apr 06 12:50:13 2012 -0700
summary:
Revert stringmap special case - I need a do-over.
files:
src/org/python/core/Py.java | 26 -------------------------
1 files changed, 0 insertions(+), 26 deletions(-)
diff --git a/src/org/python/core/Py.java b/src/org/python/core/Py.java
--- a/src/org/python/core/Py.java
+++ b/src/org/python/core/Py.java
@@ -1894,32 +1894,12 @@
new File(dir, name.substring(0, index)));
}
- /**
- * We use PyStringMap as our internal __dict__ implementation, so it should
- * compare as an instance and subclass of type dict.
- *
- * @return true if inst is a PyStringMap and cls is type dict.
- */
- private static boolean checkStringMapAsDict(PyObject inst, PyObject cls) {
- if (inst instanceof PyStringMap) {
- if (cls instanceof PyType) {
- if (((PyType)cls).equals(PyDictionary.TYPE)) {
- return true;
- }
- }
- }
- return false;
- }
-
public static boolean isInstance(PyObject inst, PyObject cls) {
// Quick test for an exact match
if (inst.getType() == cls) {
return true;
}
- if (checkStringMapAsDict(inst, cls)) {
- return true;
- }
if (cls instanceof PyTuple) {
ThreadState threadState = Py.getThreadState();
threadState.enterRecursiveCall(" in __subclasscheck__");
@@ -1988,12 +1968,6 @@
return false;
}
- // Note that we don't need to check for stringmap subclasses, since stringmap
- // can't be subclassed.
- if (checkStringMapAsDict(derived, cls)) {
- return true;
- }
-
PyObject checkerResult;
if ((checkerResult = dispatchToChecker(derived, cls, "__subclasscheck__")) != null) {
return checkerResult.__nonzero__();
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list