From: Samuele P. <pe...@in...> - 2000-12-21 14:31:13
|
Hi. [Finn] > Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32 > Type "copyright", "credits" or "license" for more information. > >>> import pack1 > >>> print pack1.Node, type(pack1.Node) > pack1.Node <type 'class'> > >>> from pack1.Node import Node > >>> print pack1.Node, type(pack1.Node) > <module 'pack1.Node' from 'pack1\Node.pyc'> <type 'module'> > > > Jython 2.0alpha2 on java1.3.0 (JIT: null) > >>> import pack1 > >>> print pack1.Node, type(pack1.Node) > pack1.Node org.python.core.PyClass > >>> from pack1.Node import Node > >>> print pack1.Node, type(pack1.Node) > pack1.Node org.python.core.PyClass > >>> The issue is clear to me, the cause of this is the following piece of code that I left around as it was: if (ret != null) { // Allow a package component to change its own meaning PyObject tmp = __dict__.__finditem__(attr); if (tmp != null) ret = tmp; __dict__.__setitem__(attr, ret); return ret; } Is that really necessary, I should study a little better CPython semantics. Then I will post a fixed fix <wink>. regards, Samuele. |
From: Samuele P. <pe...@in...> - 2000-12-22 12:58:33
|
Hi. > Yes. Please commit it. I will do that tonight. regards, Samuele. |
From: Samuele P. <pe...@in...> - 2000-12-23 00:35:44
|
Hi. [me] > Hi [Finn] > > Yes. Please commit it. > > I will do that tonight. done. PS: commit reporting seems still not to be working. |
From: <bc...@wo...> - 2000-12-23 13:59:23
|
On Sat, 23 Dec 2000 01:34:41 +0100, you wrote: >Hi. > >[me] >> Hi > [Finn] >> > Yes. Please commit it. >> >> I will do that tonight. > >done. > >PS: commit reporting seems still not to be working. Right. Atleast we have a python now on the CVS machine now. Still, mails send to jyt...@li... seems to be lost. I have added you and me as direct mail address in addition to the jython-checkins, and I at least get these direct mails. I'm way out of my depth, but it seems like the host lists.sourceforge.net isn't known from the CVS machine. Does anybody have any idea on what the problem could be? regards, finn |
From: <bc...@wo...> - 2000-12-21 15:02:14
|
[Samuele] >The issue is clear to me, the cause of this is the following piece of >code that I left around as it was: > > > if (ret != null) { > // Allow a package component to change its own meaning > PyObject tmp = __dict__.__finditem__(attr); > if (tmp != null) > ret = tmp; > __dict__.__setitem__(attr, ret); > return ret; > } > >Is that really necessary, I should study a little better CPython semantics. >Then I will post a fixed fix <wink>. Make sure that this example still works with your fix. My simple attempt to solve it (by removing the three "tmp" lines), caused this to fail: Jython 2.0alpha2 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from pawt import swing >>> swing <java package javax.swing at 4504063> >>> from pawt import swing >>> swing <java package javax.swing at 4504063> >>> regards, finn |
From: Samuele P. <pe...@in...> - 2000-12-22 02:00:27
Attachments:
patch
|
Hi. Finn, thanks for the help and the many examples. Here is a new patch proposal. The difference is minimal but significative: if (ret != null) { // Allow a package component to change its own meaning - PyObject tmp = __dict__.__finditem__(attr); - if (tmp != null) - ret = tmp; + PyObject tmp = modules.__finditem__(fullName); + if (tmp != null) ret = tmp; __dict__.__setitem__(attr, ret); return ret; } Simply the old jpython code was doing the wrong thing. I think this version should be ok for check in. Let me know. Here are the transcripts for the various test-cases with the patch in place: Jython 2.0alpha2 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from pack1.Node import Node >>> print Node,type(Node) pack1.Node.Node org.python.core.PyClass >>> Jython 2.0alpha2 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import pack1 >>> print pack1.Node,type(pack1.Node) pack1.Node org.python.core.PyClass >>> from pack1.Node import Node >>> print pack1.Node, type(pack1.Node) <module pack1.Node at 513138> org.python.core.PyModule Jython 2.0alpha2 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from pawt import swing >>> swing <java package javax.swing at 4653845> >>> from pawt import swing >>> swing <java package javax.swing at 4653845> >>> regards, Samuele Pedroni. |
From: <bc...@wo...> - 2000-12-22 11:11:22
|
[Samuele] >Finn, thanks for the help and the many examples. Here is a new patch >proposal. >The difference is minimal but significative: > > if (ret != null) { > // Allow a package component to change its own meaning >- PyObject tmp = __dict__.__finditem__(attr); >- if (tmp != null) >- ret = tmp; >+ PyObject tmp = modules.__finditem__(fullName); >+ if (tmp != null) ret = tmp; > __dict__.__setitem__(attr, ret); > return ret; > } > >Simply the old jpython code was doing the wrong thing. >I think this version should be ok for check in. Let me know. Yes. Please commit it. With the patch, it is not longer the jython import mechanism that prevent pyxml from running with jython. regards, finn |