Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e45f143

Browse files
committed
WIP on struct_sequence.rst
1 parent 71a3790 commit e45f143

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎doc/sphinx/source/struct_sequence.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
1111
.. _namedtuple: https://docs.python.org/3/library/collections.html#collections.namedtuple
1212
.. _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
1315

1416
.. _Struct Sequence API: https://docs.python.org/3/c-api/tuple.html#struct-sequence-objects
1517
.. _Struct Sequence Object: https://docs.python.org/3/c-api/tuple.html#struct-sequence-objects
@@ -37,7 +39,7 @@
3739
Struct Sequence (a ``namedtuple`` in C)
3840
==================================================
3941

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 [#]_.
4143

4244
As a reminder here is how named tuples work in Python:
4345

@@ -62,6 +64,7 @@ These are very useful in creating the equivalent of a C ``struct`` in Python.
6264

6365
.. index::
6466
single: Struct Sequence; Differences from namedtuple
67+
pair: Documentation Lacunae; Struct Sequence vs namedtuple
6568

6669
-------------------------------------------------------------------
6770
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
861864
assert err.value.args[0] == 'tuple index out of range'
862865
assert repr(ntuf) == "cStructSequence.NTWithUnnamedField(field_one='foo')"
863866
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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /