Message2482

Author fwierzbicki
Recipients
Date 2006-05-24.17:07:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=193969

That is to say I'm accepting the fixes, though I am going to
apply them to the templating code and not directly -- I've
sent an email to jython-dev and to you on the subject.  I'll
reprint here for reference:

note that in some cases instead of applying them directly to
the source code under jython/src/... I applied them to the
source generation code in sandbox/jt.  So the changes to
derived classes went into object.derived, and the changes to
the number of args sequences can take went into seq.expose.
 Followed by running:

python gderived.py dict.derived >
../../jython/src/org/python/core/PyDictionaryDerived.java

python gexpose.py dict.expose
../../jython/src/org/python/core/PyDictionary.java


python gderived.py list.derived >
../../jython/src/org/python/core/PyListDerived.java

python gexpose.py list.expose
../../jython/src/org/python/core/PyList.java

I know the templating code is pretty much undocumented at
this point, hopefully I'll eventually find time to produce
some docs for it...

I wasn't able to apply the change from looking up
__finditem__ to looking up __getitem__ (which causes the
stack overflow) because it broke test_descrtut.py, which
worked before.  Perhaps the test:

def t4():
    """
    jython recursively calls __getitem__ until it
    blows the stack
    """
    class C(dict):
        def __getitem__(self, key):
            return self.get(key)

    d = C()
    if not (d[1] == None):
        print "Failure"
    else:
        print "Success"

exposes an implementation detail... since to my eyes an
overflow doesn't seem to be surprising when a call to
self.__getitem__(key) calls self.get(key).  In any case,
we'd have to find a way so that both the test_descr test and
the test_descrtut test can pass.  The part of test_descrtut
that fails is 

    >>> exec "print foo" in a

on line 83
History
Date User Action Args
2008-02-20 17:18:31adminlinkissue1455153 messages
2008-02-20 17:18:31admincreate