-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Get some of the limited API working with Py_LIMITED_API defined #5550
Merged
da-woods
merged 41 commits into
cython:master
from
da-woods:limited-api-with-py-limited-api
Aug 14, 2023
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
658b9dc
Get a some of the limited API working with Py_LIMITED_API defined
da-woods 41807c0
Try to fix setup.py
da-woods 5349cd9
Small fixes
da-woods 037c0f3
Move guards to "assume safe macros"
da-woods 13aab71
Make arg spliting code handle avoid borrowed references
da-woods 743a2ba
Reorder imports to allow monkey patching
da-woods 8d7da21
Fix syntax error in regular mode
da-woods b9cb9d6
Merge remote-tracking branch 'real_origin/master' into limited-api-wi…
da-woods bb97acb
More fixes
da-woods b2227ab
Fix code style
da-woods 335a718
Fix a few more tests
da-woods 63a3963
Slightly improve error message
da-woods edc8242
ITEM and GetItem were the wrong way round
da-woods 0c3eba8
Fix struct definition
da-woods 516d5a7
Changes CyFunction to compile with Py_LIMITED_API
da-woods 77829d9
Remove some spurious internal includes
da-woods 5b743a1
Switch orders
da-woods 0a3163c
Fixup
da-woods 7fdefa2
Merge conditions
scoder a7262dc
Initialize weakref
da-woods ef209f8
Fix reference counting mistake
da-woods c9cdf46
Merge branch 'limited-api-cyfunc-2' into limited-api-with-py-limited-…
da-woods 5e2be08
Minimal change to get classes working
da-woods 2ca354b
Fixed borrowed reference
da-woods 6bd0f37
Merge remote-tracking branch 'real_origin/master' into limited-api-wi…
da-woods 1a5368a
Remove duplication
da-woods f2e3af8
Comments from review; get code working
da-woods 280bda5
Fix code on Py3.11 and Py3.12
da-woods 7d746b7
Remove PyCodeObject on limited API
da-woods 3cccfeb
Adapt to awkward arg naming change
da-woods 6484bdb
Let's avoid owned reference at least for the very common and safe fas…
scoder 38fb949
Reorder conditions to align them with surrounding code.
scoder e98acbe
Fix PyCode_New on 3.7
da-woods cf5facc
Replace replace on Python 3.7
da-woods 9721840
Merge remote-tracking branch 'origin/limited-api-with-py-limited-api'…
da-woods 60f8a75
Fix 3.11 typo
da-woods f932e43
Merge remote-tracking branch 'real_origin/master' into limited-api-wi…
da-woods 08744ed
Let CPython compile with assume_safe_macros
da-woods c3ba32c
Fixed function argument reference counting code
da-woods aa0a4c5
Silence warning on newref
da-woods 2c1c050
Make sure ownership is properly transford out of ParseOptionalArguments
da-woods File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just ignore this part in my review and believe both properties as you state them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look like it would slow down exception propagation considerably, though. We can probably cache the code object (or its
replace
method) and just run that each time, rather than also creating a fresh one (i.e. two) for each traceback frame.I'd be ok with keeping it as it is for now, and apply optimisations later. Let's just keep in mind that this is probably not final.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - it'd noticed that it could be cached, but was just trying to keep things simple for the initial version.
We can definitely come back and optimize this later.
I'm also open to different approaches, but I honestly couldn't think of anything else that might work.