Skip to content

Commit 3fa705a

Browse files
committed
remove PyUnicode_WCHAR_KIND from docs on Py_3_12
1 parent 16d9c56 commit 3fa705a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pyo3-ffi/src/cpython/unicodeobject.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,19 @@ impl PyASCIIObject {
287287

288288
/// Get the `kind` field of the [`PyASCIIObject`] state bitfield.
289289
///
290-
/// Returns one of: [`PyUnicode_WCHAR_KIND`], [`PyUnicode_1BYTE_KIND`], [`PyUnicode_2BYTE_KIND`],
291-
/// [`PyUnicode_4BYTE_KIND`]
290+
/// Returns one of:
291+
#[cfg_attr(not(Py_3_12), doc = "[`PyUnicode_WCHAR_KIND`], ")]
292+
/// [`PyUnicode_1BYTE_KIND`], [`PyUnicode_2BYTE_KIND`], or [`PyUnicode_4BYTE_KIND`].
292293
#[inline]
293294
pub unsafe fn kind(&self) -> c_uint {
294295
PyASCIIObjectState::from(self.state).kind()
295296
}
296297

297298
/// Set the `kind` field of the [`PyASCIIObject`] state bitfield.
298299
///
299-
/// Calling this function with an argument that is not [`PyUnicode_WCHAR_KIND`], [`PyUnicode_1BYTE_KIND`],
300-
/// [`PyUnicode_2BYTE_KIND`], or [`PyUnicode_4BYTE_KIND`] is invalid.
300+
/// Calling this function with an argument that is not
301+
#[cfg_attr(not(Py_3_12), doc = "[`PyUnicode_WCHAR_KIND`], ")]
302+
/// [`PyUnicode_1BYTE_KIND`], [`PyUnicode_2BYTE_KIND`], or [`PyUnicode_4BYTE_KIND`] is invalid.
301303
#[inline]
302304
pub unsafe fn set_kind(&mut self, val: c_uint) {
303305
let mut state = PyASCIIObjectState::from(self.state);

0 commit comments

Comments
 (0)