sphinx-doc / sphinx-doc/sphinx
Print fields in declared order for classes that extend ctypes.Structure
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
Classes that extend ctypes.Structure typically represent native C structs, in which field order and types matter. Sphinx should consider preserving this order and type declaration in the generated documentation.
Describe the solution you'd like
Generated documentation preserves field order and type.
Describe alternatives you've considered
Only preserve field order.
Only preserve field type.
Additional context
Example source:
from ctypes import Structure, c_int
class test_struct(Structure):
_fields_ = [ ('foo', c_int),
('bar', c_int) ]
Currently, Sphinx (4.3.0) produces html like:
class sphinx_struct.test_struct
Bases: _ctypes.Structure
bar
Structure/Union member
foo
Structure/Union member
but foo should appear before bar and the type (c_int) should be presented.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided ctypes.Structure example using Sphinx 4.3.0 and inspect the generated HTML; the issue names no repository files or tests to start from. Done means the generated documentation preserves the fields declaration order and presents the declared c_int type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100