Skip to content

Commit e8566a9

Browse files
clin1234Tptdavidhewitt
authored
Add PyStructSequence_UnnamedField constant (#5892)
* Add PyStructSequence_UnnamedField constant * Newsfragment Add `PyStructSequence_UnnamedField` constant. The string remains the same as of 3.10. * const * Change unnamed field to use CString * Update PyStructSequence_UnnamedField type Changed type of PyStructSequence_UnnamedField from *const c_char to *const u8. * Update pyo3-ffi/src/structseq.rs Co-authored-by: Thomas Tanon <thomas@pellissier-tanon.fr> * Drop mut Co-authored-by: David Hewitt <mail@davidhewitt.dev> * Update newsfragments/5892.added.md Co-authored-by: David Hewitt <mail@davidhewitt.dev> * Update pyo3-ffi/src/structseq.rs --------- Co-authored-by: Thomas Tanon <thomas@pellissier-tanon.fr> Co-authored-by: David Hewitt <mail@davidhewitt.dev>
1 parent 90f5e2b commit e8566a9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

newsfragments/5892.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add FFI definition `PyStructSequence_UnnamedField` constant on Python 3.9 and up (or 3.11 with abi3 features).

pyo3-ffi/src/structseq.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ pub struct PyStructSequence_Desc {
1919
pub n_in_sequence: c_int,
2020
}
2121

22-
// skipped PyStructSequence_UnnamedField;
22+
extern_libpython! {
23+
#[cfg(any(Py_3_11, all(Py_3_9, not(Py_LIMITED_API))))]
24+
pub static PyStructSequence_UnnamedField: *const c_char;
25+
}
2326

2427
extern_libpython! {
2528
#[cfg(not(Py_LIMITED_API))]

0 commit comments

Comments
 (0)