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
Merged

Conversation

@jdemeyer
Copy link
Contributor

@jdemeyer jdemeyer 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:

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

@Carreau Carreau 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 ?

Loading

@jdemeyer
Copy link
Contributor Author

@jdemeyer jdemeyer commented May 16, 2018

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

Loading

@Carreau
Copy link
Member

@Carreau Carreau commented May 16, 2018

Oh, sorry, I missread. Thanks.

Loading

@Carreau Carreau merged commit 8d399b9 into ipython:5.x May 16, 2018
3 checks passed
Loading
@Carreau Carreau added this to the 5.8 milestone May 16, 2018
vbraun added a commit to vbraun/sage that referenced this issue May 17, 2018
'''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
Copy link
Member

@Carreau Carreau commented Jul 29, 2018

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

Loading

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

Successfully merging this pull request may close these issues.

None yet

2 participants