rexec in jython??

2006-02-05 Thread Mark Fink
Hi there, I at the moment port a library from Python to Jython (at lease I try to do so :-))). The library uses the Rexec to form a type adapter to cast parameters given as text into the according Jython type. I learned rexec is not available in Jython. Is something that is commonly used in Jython

rexec in jython??

2006-02-05 Thread Mark Fink
Hi there, I at the moment port a library from Python to Jython (at lease I try to do so :-))). The library uses the Rexec to form a type adapter to cast parameters given as text into the according Jython type. I learned rexec is not available in Jython. Is something that is commonly used in Jython

Re: rexec in jython??

2006-02-05 Thread Mark Fink
sorry for the double post! It is the r_eval() functionality of the rexec module I am looking forward to replace -- http://mail.python.org/mailman/listinfo/python-list

Re: rexec in jython??

2006-02-05 Thread Mark Fink
this is really funny... I tried to use eval(String) as an replacement. It works now but the calculation results from my tests are not as expected: 2 + 3 = 23 !!! 2 - 3 = 2-3... I have the feeling that there is a really easy solution for this. Unfortunately I have no enough experience --

Re: rexec in jython??

2006-02-05 Thread Diez B. Roggisch
Mark Fink wrote: this is really funny... I tried to use eval(String) as an replacement. It works now but the calculation results from my tests are not as expected: 2 + 3 = 23 !!! 2 - 3 = 2-3... I have the feeling that there is a really easy solution for this. Unfortunately I have no enough

Re: rexec in jython??

2006-02-05 Thread Mark Fink
This is the original code section of the library including the comments: class AutoAdapter(TypeAdapter): This adapter returns a type based on the format of the table cell contents, following python's rules for literals (plus a few others). We could fall back on this when we don't

Re: rexec in jython??

2006-02-05 Thread Diez B. Roggisch
Mark Fink wrote: This is the original code section of the library including the comments: class AutoAdapter(TypeAdapter): This adapter returns a type based on the format of the table cell contents, following python's rules for literals (plus a few others). We could fall

Re: rexec in jython??

2006-02-05 Thread Mark Fink
:-))) it works! I replaced it to return eval(s) and the results look extremely well guess I should get one of this crystal balls myself. one minor issue is still left: correct me if I am wrong: result of 2/-3 is 0 (at least this is how it is defined in the testcase) In Jython 2.1.3: 2/-3 -1