10
10
11
11
.. _namedtuple : https://docs.python.org/3/library/collections.html#collections.namedtuple
12
12
.. _namedtuples : https://docs.python.org/3/library/collections.html#collections.namedtuple
13
+ .. _dataclass : https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass
14
+ .. _dataclasses : https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass
13
15
14
16
.. _Struct Sequence API : https://docs.python.org/3/c-api/tuple.html#struct-sequence-objects
15
17
.. _Struct Sequence Object : https://docs.python.org/3/c-api/tuple.html#struct-sequence-objects
37
39
Struct Sequence (a ``namedtuple `` in C)
38
40
==================================================
39
41
40
- A `Struct Sequence Object `_ object is, more or less, the C equivalent of Python's `namedtuple `_ type.
42
+ A `Struct Sequence Object `_ object is, more or less, the C equivalent of Python's `namedtuple `_ type [ # ]_ .
41
43
42
44
As a reminder here is how named tuples work in Python:
43
45
@@ -62,6 +64,7 @@ These are very useful in creating the equivalent of a C ``struct`` in Python.
62
64
63
65
.. index ::
64
66
single: Struct Sequence; Differences from namedtuple
67
+ pair: Documentation Lacunae; Struct Sequence vs namedtuple
65
68
66
69
-------------------------------------------------------------------
67
70
Differences Between a C Struct Sequence and a Python `namedtuple `_
@@ -861,3 +864,9 @@ Once built this can be accessed from Python (see ``tests/unit/test_c_struct_sequ
861
864
assert err.value.args[0 ] == ' tuple index out of range'
862
865
assert repr (ntuf) == " cStructSequence.NTWithUnnamedField(field_one='foo')"
863
866
assert str (ntuf) == " cStructSequence.NTWithUnnamedField(field_one='foo')"
867
+
868
+ .. Example footnote [#]_.
869
+
870
+ .. rubric :: Footnotes
871
+
872
+ .. [# ] `namedtuples `_ have been largely superseded by `dataclasses `_ and the is no direct C equivalent for them.
0 commit comments