Repository navigation
Commit cc0e902
gh-87613: Name the subclass in Argument Clinic
tp_new is inherited, so argument errors from a subclass named the base
type. While `tp_name` would be slightly faster to use it includes the
module name like `_thread.RLock()` which adds confusion. Use
`_PyType_Name(type)` which returns `RLock()`. Include a test to check.
_PyArg_NoPositional() only short-circuits when args is NULL, which
tp_new never gets; use _PyArg_NoPositionalStack() to keep the name
lookup off the success path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>__new__ argument errors1 parent 6c695bf commit cc0e902
26 files changed
Lines changed: 115 additions & 98 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Tools-Demos
- Modules
- _sqlite/clinic
- clinic
- Objects/clinic
- Python/clinic
- Tools/clinic/libclinic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4968 | 4968 | | |
4969 | 4969 | | |
4970 | 4970 | | |
4971 | | - | |
| 4971 | + | |
4972 | 4972 | | |
4973 | 4973 | | |
4974 | 4974 | | |
| |||
5017 | 5017 | | |
5018 | 5018 | | |
5019 | 5019 | | |
5020 | | - | |
| 5020 | + | |
5021 | 5021 | | |
5022 | 5022 | | |
5023 | 5023 | | |
| |||
5042 | 5042 | | |
5043 | 5043 | | |
5044 | 5044 | | |
5045 | | - | |
| 5045 | + | |
5046 | 5046 | | |
5047 | 5047 | | |
5048 | 5048 | | |
5049 | | - | |
| 5049 | + | |
5050 | 5050 | | |
5051 | 5051 | | |
5052 | 5052 | | |
| |||
5057 | 5057 | | |
5058 | 5058 | | |
5059 | 5059 | | |
5060 | | - | |
| 5060 | + | |
5061 | 5061 | | |
5062 | 5062 | | |
5063 | 5063 | | |
| |||
5248 | 5248 | | |
5249 | 5249 | | |
5250 | 5250 | | |
5251 | | - | |
| 5251 | + | |
5252 | 5252 | | |
5253 | 5253 | | |
5254 | 5254 | | |
| |||
5263 | 5263 | | |
5264 | 5264 | | |
5265 | 5265 | | |
5266 | | - | |
| 5266 | + | |
5267 | 5267 | | |
5268 | 5268 | | |
5269 | 5269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5806 | 5806 | | |
5807 | 5807 | | |
5808 | 5808 | | |
| 5809 | + | |
| 5810 | + | |
| 5811 | + | |
| 5812 | + | |
| 5813 | + | |
| 5814 | + | |
| 5815 | + | |
| 5816 | + | |
| 5817 | + | |
| 5818 | + | |
| 5819 | + | |
5809 | 5820 | | |
5810 | 5821 | | |
5811 | 5822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments