Advertisement
Guest User

Untitled

a guest
Apr 26th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. # test.pyx
  2. class Foo:
  3.     def __init__(self, x, y):
  4.         self.x = x
  5.         self.y = y
  6.  
  7. # test2.py
  8. import pyximport
  9. pyximport.install()
  10. import test
  11. foo = test.Foo(1, 2)
  12. print foo.x, foo.y
  13.  
  14. # % python2.7 test2.py
  15. # Traceback (most recent call last):
  16. #   File "test2.py", line 4, in <module>
  17. #     foo = test.Foo(1, 2)
  18. # AttributeError: 'module' object has no attribute 'Foo'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement