Skip to content

Commit 12acbff

Browse files
improve comment
1 parent e1f34a6 commit 12acbff

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/native/contextvar.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ use pyo3::ffi;
22
use pyo3::prelude::*;
33
use std::ffi::CString;
44

5-
// PyContextVar_* are public CPython C-API symbols (since 3.7), not Limited API.
6-
// pyo3-ffi omits them under Py_LIMITED_API. Local decls so this module builds
7-
// when that cfg is on.
5+
/// PyContextVar_New/_Get/_Set are absent from pyo3-ffi's limited-API bindings (Py_LIMITED_API),
6+
/// which can be enabled via PYO3_USE_ABI3_FORWARD_COMPATIBILITY.
7+
/// Declare the CPython C-API entry points locally so this module builds either way.
8+
/// Context variables were introduced in Python 3.7, so these symbols exist on every supported CPython.
89
unsafe extern "C" {
910
fn PyContextVar_New(
1011
name: *const std::os::raw::c_char,

0 commit comments

Comments
 (0)