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

signature: use inspect instead of type checks #11139

Merged
merged 1 commit into from May 16, 2018

Conversation

@jdemeyer
Copy link
Contributor

commented May 16, 2018

Using inspect.isfunction is more future-compatible in case that the implementation of inspect.isfunction ever changes.

In SageMath, we actually monkey-patch inspect.isfunction to allow for Cython functions. So while this patch doesn't change anything at all in vanilla Python, it is important for Cython support.

More context:

Jeroen Demeyer

@jdemeyer jdemeyer changed the title Use inspect instead of type checks signature: use inspect instead of type checks May 16, 2018

@Carreau

This comment has been minimized.

Copy link
Member

commented May 16, 2018

+1.

Do you think it is worth backporting to 5.x (Python 2.7), or can this be a carrot for 3.x users ?

@jdemeyer

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2018

It's a pull request to the 5.x branch. It only makes sense on Python 2.

@Carreau

This comment has been minimized.

Copy link
Member

commented May 16, 2018

Oh, sorry, I missread. Thanks.

@Carreau Carreau merged commit 8d399b9 into ipython:5.x May 16, 2018

3 checks passed

codecov/patch 25% of diff hit (target 0%)
Details
codecov/project 66.3% (+<.01%) compared to ff9e9a5
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Carreau Carreau added this to the 5.8 milestone May 16, 2018

vbraun added a commit to vbraun/sage that referenced this pull request May 17, 2018

Trac #25373: Add IPython support for Cython functions
'''Upstream''': ipython/ipython#11139

This is required for correct `interact` support of Cython functions, see
#24994. The doctest added here is also meant to test a problem
discovered on #24994.

URL: https://trac.sagemath.org/25373
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Frédéric Chapoton
@Carreau

This comment has been minimized.

Copy link
Member

commented Jul 29, 2018

@jdemeyer released on PyPI, I'll update the conda recipe later.

@Carreau Carreau referenced this pull request Mar 26, 2019

Closed

No release notes for 5.8 #11661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.