<div class="gmail_quote">On Fri, Oct 22, 2010 at 5:35 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com">takowl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><div class="gmail_quote">On 23 October 2010 00:04,  <span dir="ltr"><<a href="mailto:ipython-dev-request@scipy.org" target="_blank">ipython-dev-request@scipy.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">



<div>Trying a little bit more by disabling that version check, I discovered that<br>
at least 2.6's support of print as a function, instead of a statement, is<br>
used. Now Jython 2.6 work kicked off just this week, so hopefully we don't<br>
really need 2.6. Jython 2.5 does have two key 2.6 features that you might be<br>
using: 1) full mutable ast support (through the ast module, used by sympy's<br>
support); 2) class decorators. (We also have namedtuple.)<br>
<br>
Maybe for Jython this is just a matter of isolating the print function? It<br>
doesn't seem to be used in too many places.</div></blockquote></div><br></div>Just to chime in here, we have been working on the principle that ipython 0.11 would depend on Python 2.6 or later, and I've been 'modernising' the code base a bit, to fit in with my Python 3 branch of ipython. I'm sorry if this makes your life harder. Off the top of my head, though, I think most if not all of my changes should be compatible with 2.5.<br>

</blockquote><div><br></div><meta charset="utf-8"><div>Sounds reasonable to have a small compatibility shim then for 2.5. The other piece I've found so far is switching from compiler to _ast (assuming CPython 2.5 compliance of course); neither Python 3 nor Jython supports the old-style syntax tree. Casually inspecting the usage of the compiler module suggests that there's not much use. In core, kernel.core.interpreter and core.inputsplitter seem to have significant code duplication in their use of compiler to get line numbers. We do support codeop, so that should work as soon as it's made valid for future imports.</div>

<div><br></div><div>Incidentally the problem I noticed earlier in parsing a statement like "print 42" was with codeop.CommandCompiler, not the compiler module. Apparently ipython expects CPython's behavior of codeop.CommandCompiler().compiler.flags, which is an int, whereas Jython has this as codeop.CommandCompiler()._cflags, which is a structure. Strange, I thought this was being exposed as an int for compatibility in this fashion. Maybe we should fix that part for 2.5.2rc2. I'll take a look at it.</div>

<div><br></div><div>- Jim</div><div><br></div></div>