docs: note with_gil auto-creates thread state

This commit is contained in:
David Hewitt 2022-08-21 16:26:33 +01:00
parent fb05e1d7a7
commit f7ebda8ce3
1 changed files with 4 additions and 0 deletions

View File

@ -288,6 +288,10 @@ impl Python<'_> {
#[cfg_attr(PyPy, doc = "`prepare_freethreaded_python`")]
/// for details.
///
/// If the current thread does not yet have a Python "thread state" associated with it,
/// a new one will be automatically created before `F` is executed and destroyed after `F`
/// completes.
///
/// # Panics
///
/// - If the [`auto-initialize`] feature is not enabled and the Python interpreter is not