Skip to content

Moving tp_class access, and consistent fully-qualified naming for PyPy, to detail::get_tp_name - #2520

Merged
henryiii merged 2 commits into
pybind:masterfrom
YannickJadoul:pypy-tp_name
Oct 2, 2020
Merged

Moving tp_class access, and consistent fully-qualified naming for PyPy, to detail::get_tp_name#2520
henryiii merged 2 commits into
pybind:masterfrom
YannickJadoul:pypy-tp_name

Conversation

@YannickJadoul

Copy link
Copy Markdown
Collaborator

Increasing consistency, cfr. #2349 (comment)

@YannickJadoul
YannickJadoulforce-pushed the pypy-tp_name branch 2 times, most recently from 110b168 to b4dc8e3CompareSeptember 21, 2020 23:01


@pytest.mark.xfail("env.PYPY")
@pytest.mark.xfail("env.PYPY and sys.pypy_version_info < (7, 3, 2)")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Expect this to fail on PyPy < 7.3.2"

Didn't we decide to drop older versions already?

@YannickJadoulYannickJadoulSep 22, 2020

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7.3.2 is not out, yet. And it still fails on 7.3.1 :-)

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If 7.3.2 is out before this gets merged, yes, let's remove it

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(unrelated change, btw, but something I bumped into, when testing locally)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably wouldn't drop it right away; approximately supporting 7.3.0+ would probably be ideal.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's probably best.

#endif

inline std::string get_tp_name(PyTypeObject *type) {
#if !defined(PYPY_VERSION)

@henryiiihenryiiiSep 25, 2020

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens in 7.3.2? Does the line below start working?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, no. I believe the @pytest.mark.xfail("env.PYPY and sys.pypy_version_info < (7, 3, 2)") is unrelated (but I just came across it because I tested with 7.3.2.)

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh .. I'd written this yesterday, but it was still a "pending review" ...

@henryiiihenryiii added this to the v2.6.0 milestone Sep 25, 2020

@rwgkrwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great step in the right direction.
Are there existing unit tests for built-in types and nested classes? (If not it would be OK with me to add them later.)

Comment threadinclude/pybind11/detail/class.h Outdated
@YannickJadoul

Copy link
Copy Markdown
CollaboratorAuthor

Are there existing unit tests for built-in types and nested classes? (If not it would be OK with me to add them later.)

I think so, yes. Do the tests that I had to change (because PyPy is now consistent with CPython) count?

@rwgkrwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Yannick! I think this is good to merge, to help you finishing up #2349. I didn't have a chance to look into existing unit test coverage beyond the changes in test_class.py here, but we can look into that separately, later, or as the need arises.

Comment threadinclude/pybind11/detail/class.h Outdated
@YannickJadoul

Copy link
Copy Markdown
CollaboratorAuthor

OK, sounds good to me. Thanks, @rwgk!

@henryiii

Copy link
Copy Markdown
Collaborator

This seems safe to put in; would like to slowly keep a little momentum heading into 2.6.0.

@henryiii
henryiii merged commit c72708a into pybind:masterOct 2, 2020
@YannickJadoul
YannickJadoul deleted the pypy-tp_name branch October 3, 2020 21:10
@rwgkrwgk mentioned this pull request Feb 10, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@YannickJadoul@henryiii@rwgk@bstaletic