You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on another topic I noticed this cfg entry:
// PyInterpreterState_Get is only available on 3.9 and later, but is missing// from python3.dll for Windows stable API on 3.9#[cfg(all(Py_3_9, not(all(windows,Py_LIMITED_API, not(Py_3_10)))))]
I don't have an environment in place to test, nor have I experienced any issues with this, but reading the logic it seems to be potentially incorrect and I thought it safer to point this out at the risk of raising an incorrect issue.
I think that the not(all(windows, Py_LIMITED_API, not(Py_3_10))) clause cannot be true if Py_3_9 is true - as the windows clause requires Py_3_10. Logically: 3.9 AND (NOT (win AND Lim AND NOT 3.10)) = 3.9 AND NOT win AND NOT Lim AND 3.10 (but my brain is hurting already ;))
If I understand the comment correctly then the first code block should only be executed on >3.10 on windows or on >3.9 on other platforms. This would suggest the logic similar to: (3.9 AND NOT win) OR 3.10.
Assuming that the cfg flag Py_3_x equivalent to >=Py3.x then I think this should translate to something like: #[cfg(any(Py_3_10, all(Py_3_9, not(all(windows, Py_LIMITED_API))))] - that should also be not-able for the second block ...
The text was updated successfully, but these errors were encountered:
While working on another topic I noticed this
cfg
entry:at
pyo3/src/impl_/pymodule.rs
Line 107 in f5fee94
and then negated at
pyo3/src/impl_/pymodule.rs
Line 127 in f5fee94
I don't have an environment in place to test, nor have I experienced any issues with this, but reading the logic it seems to be potentially incorrect and I thought it safer to point this out at the risk of raising an incorrect issue.
I think that the
not(all(windows, Py_LIMITED_API, not(Py_3_10)))
clause cannot be true ifPy_3_9
is true - as the windows clause requiresPy_3_10
. Logically:3.9 AND (NOT (win AND Lim AND NOT 3.10)) = 3.9 AND NOT win AND NOT Lim AND 3.10
(but my brain is hurting already ;))If I understand the comment correctly then the first code block should only be executed on >3.10 on windows or on >3.9 on other platforms. This would suggest the logic similar to:
(3.9 AND NOT win) OR 3.10
.Assuming that the cfg flag Py_3_x equivalent to >=Py3.x then I think this should translate to something like:
#[cfg(any(Py_3_10, all(Py_3_9, not(all(windows, Py_LIMITED_API))))]
- that should also be not-able for the second block ...The text was updated successfully, but these errors were encountered: