@@ -501,7 +501,7 @@ Suppose that we have a simple struct representing a transaction.
501
501
double amount; /* The transaction amount. */
502
502
};
503
503
504
- An we have a C function that can recover a transaction given its ID:
504
+ And we have a C function that can recover a transaction given its ID:
505
505
506
506
.. code-block :: c
507
507
@@ -659,6 +659,7 @@ There some illustrative tests ``test_excess_nt_*`` in ``tests/unit/test_c_struct
659
659
.. index ::
660
660
single: Struct Sequence; Unnamed Fields
661
661
single: Struct Sequence; PyStructSequence_UnnamedField
662
+ pair: Documentation Lacunae; Struct Sequence Unnamed Fields
662
663
663
664
---------------------------------------------
664
665
Unnamed Fields
@@ -671,7 +672,7 @@ here.
671
672
672
673
.. note ::
673
674
674
- Unnamed fields doe not appear to work in Python versions prior to 3.11 with the following compile time error:
675
+ Unnamed fields does not appear to work in Python versions prior to 3.11 with the following compile time error:
675
676
676
677
``E ImportError: dlopen(... cStructSequence.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_PyStructSequence_UnnamedField' ``
677
678
@@ -859,9 +860,9 @@ Once built this can be accessed from Python (see ``tests/unit/test_c_struct_sequ
859
860
assert ntuf.n_unnamed_fields == 1
860
861
assert tuple (ntuf) == (' foo' ,)
861
862
assert ntuf[0 ] == ' foo'
862
- # Will raise an IndexError
863
- # assert ntuf[1] == 'bar'
864
- assert err.value.args[ 0 ] == ' tuple index out of range '
863
+ # Will raise an IndexError: 'tuple index out of range'
864
+ with pytest.raises( IndexError ) as err:
865
+ assert ntuf[ 1 ] == ' bar '
865
866
assert repr (ntuf) == " cStructSequence.NTWithUnnamedField(field_one='foo')"
866
867
assert str (ntuf) == " cStructSequence.NTWithUnnamedField(field_one='foo')"
867
868
0 commit comments