Skip to content

bpo-41073: PyType_GetSlot() could accept static types. #21395

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

Closed
wants to merge 197 commits into from

Conversation

shihai1991
Copy link
Member

@shihai1991 shihai1991 commented Jul 8, 2020

@shihai1991
Copy link
Member Author

@vstinner @encukou pls take a look if you have free time, thanks.

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

This will not work with static types. Try adding some tests, and look at how PyHeapTypeObject is different from PyTypeObject. You should see why.
Sadly I don't have time right now to go into detail, but I'll be happy to add more later. Let me know if you get stuck.

#define Py_tp_version_tag 96
#define Py_tp_weaklist 97
#define Py_tp_weaklistoffset 98
#endif
Copy link
Member

Choose a reason for hiding this comment

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

These should not be part of the limited API. See Py_bf_getbuffer above for how to exclude them.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, I will update it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like we juse need define it and it don't need to be excluded, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi, petr. I create a test module(_testgettypeslots) to see the blocks, but I am not get stuck,: shihai1991#18

Do we need add some special test cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi, petr. Due to my stupied rebase operation, I decide to create a new PR: #21931

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@shihai1991
Copy link
Member Author

This will not work with static types. Try adding some tests, and look at how PyHeapTypeObject is different from PyTypeObject. You should see why.
Sadly I don't have time right now to go into detail, but I'll be happy to add more later. Let me know if you get stuck.

Copy that, Let me try it.

vstinner and others added 20 commits August 21, 2020 01:06
…strings (pythonGH-21369)

* Document is_annotate() and update doc strings

* Move quotes to the next line.

Co-authored-by: Pablo Galindo <[email protected]>

Co-authored-by: Pablo Galindo <[email protected]>
…onGH-21401)

The running loop holder cache variable was always set to NULL when
calling set_running_loop.

Now set_running_loop saves the newly created running loop holder in the
cache variable for faster access in get_running_loop.

Automerge-Triggered-By: @1st1
…bject (pythonGH-21240)

The issue is triggered by the bytearray() + bytearray() operation.

Detected by GCC 10 static analysis tool.
)

* Add failing test.

* bpo-29590: fix stack trace for gen.throw() with yield from (GH-NNNN)

When gen.throw() is called on a generator after a "yield from", the
intermediate stack trace entries are lost.  This commit fixes that.
The >>> as the last line serve no purpose and are not colored correctly by Sphinx.
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
* Clarify __deepcopy__ memo dict argument usage

* Add full stop
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@Akuli

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@shihai1991
Copy link
Member Author

Sorry for my terrible PR~

@methane
Copy link
Member

methane commented Aug 21, 2020

"rebase" creates this type of trouble sometime. You can use "merge" instead.
See https://discuss.python.org/t/info-rebase-origin-master-push-f-workflow-corrupts-pull-request-rarely/2558 for detail.

@shihai1991
Copy link
Member Author

"rebase" creates this type of trouble sometime. You can use "merge" instead.
See https://discuss.python.org/t/info-rebase-origin-master-push-f-workflow-corrupts-pull-request-rarely/2558 for detail.

Thanks a million, Inada. It's very useful to me. I haven't found some useful info in google and not sure git merge is a good way to reslove this problem before, Lol~

@Akuli
Copy link
Contributor

Akuli commented Aug 21, 2020

You might like git lola. I use it a lot and I probably couldn't use git without it. It displays your git history as a nice tree that very clearly shows what's going on with branches and merges.

@shihai1991
Copy link
Member Author

shihai1991 commented Aug 21, 2020

You might like git lola. I use it a lot and I probably couldn't use git without it. It displays your git history as a nice tree that very clearly shows what's going on with branches and merges.

Thanks. I will try to use it ;) The problem in this PR is that I can not easy use git rebase to update the ancestor commit of old feature develop branch.

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

Successfully merging this pull request may close these issues.