Better support Pypy #719

fperez opened this Issue Aug 22, 2011 · 5 comments

3 participants

IPython member

With pypy 1.6, ipython 0.10.2 works reasonably well, but current master completely fails to even start, with this error:

Original exception was:
Traceback (most recent call last):
  File "", line 53, in run_toplevel
  File "/home/fperez/usr/bin//ipython", line 7, in 
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 385, in launch_new_instance
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 299, in initialize
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 319, in init_shell
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/config/", line 295, in instance
    inst = cls(*args, **kwargs)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 113, in __init__
    user_global_ns=user_global_ns, custom_exceptions=custom_exceptions
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 388, in __init__
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 1399, in init_history
    self.history_manager = HistoryManager(shell=self, config=self.config)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 127, in __init__
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 154, in new_session
    self.session_number = cur.lastrowid
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 302, in __set__
    new_value = self._validate(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 310, in _validate
    return self.validate(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 873, in validate
    self.error(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 333, in error
    raise TraitError(e)
TraitError: The 'session_number' trait of a HistoryManager instance must be an integer, but a value of 590L  was specified.

We should look into making the traits type checks be more pypy-friendly, if possible. Pypy now has preliminary numpy support, so it's starting to become slowly a contender for scientific use.

IPython member

it's probably pretty easy to get the traits, etc. working for terminal IPython. However, I think the qtconsole, notebook, and parallel code are simply nonstarters thanks to pyzmq.

IPython member

Sure! I just figured we should do our best, for now, to keep the console/readline ipython working in pypy.

Later, as they make more progress on extension support, we'll see about the pieces that need zmq, but all that worries me much less.

We've always said there is a 'core' part of ipython that runs with only the stdlib. That's the part I want to try to keep pypy-friendly.

IPython member
IPython member

I've done this a couple of times, and kept meaning to commit the fix. Changing Int to CInt gets it started, but there are still some problems with readline.

@takluyver takluyver added a commit to takluyver/ipython that referenced this issue Aug 22, 2011
@takluyver takluyver Use casting trait for session number in history, so IPython will star…
…t on PyPy.

Closes gh-719
IPython member

There's still room for improvement here, but PR #722 should have closed this, but the auto-close failed.

@minrk minrk closed this Sep 9, 2011
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@takluyver takluyver Use casting trait for session number in history, so IPython will star…
…t on PyPy.

Closes gh-719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment