traits icon indicating copy to clipboard operation
traits copied to clipboard

Support PyPy?

Open mdickinson opened this issue 2 years ago • 0 comments

I was rather surprised to discover that it's possible to at least install Traits on PyPy, that basic operations work, and that at least some of the test suite passes.

We don't have any strong need to support PyPy right now, but it might be interesting to establish just how much work supporting PyPy would entail.

(pypy-testing) mdickinson@mirzakhani traits % python
Python 3.7.9 (7e6e2bb30ac5fbdbd443619cae28c51d5c162a02, Sep 03 2021, 06:59:13)
[PyPy 7.3.3-beta0 with GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``snow, snow! :-)''
>>>> import traits
>>>> from traits.api import *
>>>> class A(HasTraits):
....     foo = Int()
....     @observe("foo")
....     def _report_foo_change(self, event):
....         print("foo changed: ", event)
....         
>>>> a = A()
>>>> a.foo = 34
foo changed:  TraitChangeEvent(object=<__main__.A object at 0x00007f96e0bcc9f8>, name='foo', old=0, new=34)

Related: https://doc.pypy.org/en/latest/faq.html#do-c-extension-modules-work-with-pypy

mdickinson avatar Oct 04 '21 17:10 mdickinson