-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed as not planned
Closed as not planned
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
It'll be great to add IWYU pragma: begin_exports
/IWYU pragma: end_exports
around internal CPython headers in Python.h
.
Currently Clang Include Cleaner complains that Python.h
is not used as well as headers for all used parts of CPython API are not included directly.
Example output snippet for Clang Include Cleaner run as Clang-Tidy check:
test.cpp:10:1: warning: included header Python.h is not used directly [misc-include-cleaner]
10 | #include <Python.h>
| ^~~~~~~~~~~~~~~~~~~
11 | #include <cstddef>
test.cpp:50:5: warning: no header providing "PyObject_HEAD" is directly included [misc-include-cleaner]
50 | PyObject_HEAD
| ^
test.cpp:57:1: warning: no header providing "PyObject" is directly included [misc-include-cleaner]
12 | PyObject* test_iter_new(Test_Object* element, PyTypeObject* iter_type)
| ^
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement