-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-124153: Introduce PyType_GetBaseByToken function (PoC) #121079
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
Closed
Changes from 98 commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
eb0d23d
add document
neonene 273bac1
introduce Py_tp_token and ht_token
neonene d041167
fix PyType_GetSlot()
neonene d41cead
add PyType_GetBaseByToken() PyType_GetToken()
neonene 1456baa
add test
neonene 14b4103
add ctypes example
neonene 7af3378
use tp_mro directly (like PyType_IsSubtype) for free-threading err
neonene 0b8bd07
silence warning
neonene f917ad9
edit testcase
neonene e08d58f
remove an assertion
neonene 22c20d9
add missing cast
neonene 7fa0d81
cast again
neonene 5621704
edit testcase
neonene 492a7d5
remove redundant testcase
neonene f71fa78
edit testcase
neonene 83760d7
add test for no-result mode 1/2
neonene 245d9d4
add test for no-result mode 2/2
neonene a0858a7
edit test
neonene 4fb9cf8
add functions to check perf
neonene eb29cf8
remove previous experiment commit
neonene ccd5ede
abandon the proposal of PyType_GetToken()
neonene 7d3f8b6
optimize GetBaseByToken like GetModuleByDef
neonene 100972d
add a repeat test (temporary use)
neonene c58ef1c
Merge branch 'main' into bytoken
neonene 7e89a98
fix a build error
neonene 1de4cba
remove the repeat test
neonene c0d4210
add Py_TP_USE_SPEC to the test module
neonene 68c4b8a
remove a duplicate GetSlot test
neonene b0cb58a
tweak GetBaseBytoken()
neonene 2e59344
add repeat tests
neonene 8f74f7f
Merge branch 'main' into bytoken
neonene 7fcf53e
Use Py_TP_USE_SPEC in PyType_FromMetaclass()
neonene a1ac466
Merge branch 'main' into bytoken
neonene 2312cac
reword
neonene 958d845
typo
neonene a1736b0
Doc: GetSlot() returns &spec with Py_TP_USE_SPEC
neonene 295f498
fix comment in test
neonene f45e4d0
remove repeat tests
neonene 9e1857e
Merge branch 'main' into bytoken
neonene f5c082b
Reword/rearrange documentation
encukou 1f5e289
Add to stable ABI
encukou 0e14a59
Nitpick: Add new field at the end
encukou ab9dc41
PyType_GetBaseByToken: Raise exceptions for user errors
encukou 00c0b7b
Add internal comments
encukou 99362b2
Merge pull request #1 from encukou/bytoken
neonene df696ed
Merge branch 'main' into bytoken
neonene c75e355
consider the suggestion in create_type_with_token()
neonene fbdec08
remove a cast
neonene 5341b1d
move a doc right under PyType_GetModuleByDef()
neonene 79ef825
cleanup create_type_with_token()
neonene 1bb40b8
fix a typo in the doc
neonene 249c8fa
clarify an example code in the doc
neonene bfc9321
Merge branch 'main' into bytoken
neonene 5967fd0
apply proposal to ctypes completely
neonene 82f511e
What's New
neonene 4507079
doc: fix the slot example usage
neonene 92b08eb
ditto
neonene eb4c2f8
doc: use a pronoun
neonene 7cd33c9
Merge branch 'main' into bytoken
neonene 910c596
Merge branch 'main' into bytoken
neonene a1444bd
ctypes: fix an error handling
neonene d9fce25
ctypes: do not print metaclass on error
neonene 3faf73a
ctypes: reword a comment
neonene 9f953c2
Merge branch 'main' into bytoken
neonene fc39abc
static type check first
neonene 90edfef
revert for correctness
neonene f21b166
update test
neonene 6f6ae41
apply proposal to defdict_or() in _collectionsmodule.c
neonene a73f956
apply proposal to _decimal.c (replace _PyType_GetModuleByDef2)
neonene 04d74bb
Merge branch 'main' into bytoken
neonene 1d17bec
_decimal: make the code PGO-friendly with MSVC
neonene 7324e2b
move an assert and a comment
neonene a2fd0ff
nits
neonene ec77d16
edit whats new
neonene 5c5daa9
use _PyType_CAST in recursive function
neonene 7735ef1
setup fixed repeat tests
neonene eaa3007
revert repeat tests
neonene 15e0582
_decimal: simplify dec_richcompare()
neonene 52616f1
_decimal: restore PyType_GetModuleByDef() in bin-ops
neonene 5e094d0
Merge branch 'main' into bytoken
neonene ac03429
fix build error
neonene ac82d36
optimize PyType_GetBaseByToken()
neonene 2a24934
_decimal: improve performance
neonene ce68195
Merge branch 'main' into bytoken
neonene fa936d7
rename
neonene a9121fc
clarify the optimizations
neonene 7f50633
typo
neonene ea6e9d3
Add a private function and use it
neonene 60779f8
Merge branch 'main' into bytoken
neonene 588d5ee
revert private function (borrowed ref ver.)
neonene de19b5a
Merge branch 'main' into bytoken
neonene b730abb
edit header file
neonene 77f143a
bad PyType_GetBaseByToken() example
neonene b114bc8
recover performance when a reference is needed
neonene 08bfb87
Merge branch 'main' into bytoken
neonene f08da25
edit PyType_GetBaseByToken()
neonene e3c1182
recover performance take2
neonene d95e422
Merge branch 'main' into bytoken
neonene 974fce3
do not exercise in ctypes
neonene 61bb346
edit this version of PyType_GetBaseByToken()
neonene cd750ca
ditto
neonene ca3043f
📜🤖 Added by blurb_it.
blurb-it[bot] 5ccf0b8
typo
neonene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Could you remove the exercise from this PR?
Hopefully the training will get better as
PyType_GetBaseByToken
is used more; if not, we can adjust it in a future PR.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 post a new PR. It may be better to have a dedicated branch when the
result
argument isNULL
.