Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cython closures not bound as methods #900

Closed
robertwb opened this issue Jan 21, 2010 · 3 comments
Closed

Cython closures not bound as methods #900

robertwb opened this issue Jan 21, 2010 · 3 comments

Comments

@robertwb
Copy link
Contributor

This is especially relevant to using closures to decorate methods.

sage: class A:
....:     foo = lambda *x: x
....:     
sage: A.foo
<unbound method A.<lambda>>
sage: A().foo
<bound method A.<lambda> of <__main__.A instance at 0xacafee0>>
sage: A().foo()
(<__main__.A instance at 0xacd8080>,)

Rather than using the method binding trick ourselves, we need to make closures into a class with __call__, __get__, and __set__ methods.

Migrated from http://trac.cython.org/ticket/478

@robertwb
Copy link
Contributor Author

robertwb commented Jan 29, 2010

@robertwb commented

See also http://trac.cython.org/ticket/494

@robertwb
Copy link
Contributor Author

robertwb commented Jan 31, 2010

@robertwb changed milestone from wishlist to 0.13
owner to robertwb
commented

Tests at http://hg.cython.org/cython-closures/rev/ea90bf6a4c3a now that the http://trac.cython.org/ticket/494 framework is in place.

@robertwb
Copy link
Contributor Author

@robertwb changed resolution to fixed
status from new to closed
commented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant