-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GIL Refs API Removal - Tracking Issue #3960
Comments
Question: What do we need to do with Except |
I think It might mean it's necessary to have an extra level of indirection e.g. |
Pain point here: https://github.com/PyO3/pyo3/blob/main/pyo3-macros-backend/src/pyclass.rs#L1281-L1285 This unconditionally generates emits this, and currently |
Another pain point is |
There's an item for 0.22, " Update documentation on Python type". A quick review of the struct-level docs didn't indicate anything obviously wrong. Anyone recall what that's a reference to? |
I think what I wanted is just this: #4274 |
Presumably all the documentation about |
Right, I remember this came up in discord. I think it's important that this prose exists somewhere in the api docs, and that the current place is the right place - IMO it's too specific to go on top of Py or Bound. We should definitely remove the references to PyCell itself though, and probably rename the module. |
As 0.23 is nearly ready and I believe we have cleaned up everything (thanks @Icxolu!), I think this tracking issue doesn't have much value left. Let's close, and if there are small cleanups remaining, they can be done ad-hoc. Well done everyone! |
The main steps remaining to remove GIL Refs:
For 0.22
In 0.22 the
gil-refs
feature will continue to be available, but with two major differences from 0.21. The deprecation warnings will be unconditional and the APIs will be gated behind the feature.Upgrade all of the deprecated APIs to be gated behind the
gil-refs
feature:To
buffer.rs
feature gate deprecated APIs forPyBuffer
#4144conversion.rs
feature gate deprecated APIs forPython
#4173conversions/num_complex.rs
feature gate deprecated APIs forPyFloat
andPyComplex
#4145err/mod.rs
feature gate deprecated APIs forPyErr
and exceptions #4136exceptions.rs
feature gate deprecated APIs forPyErr
and exceptions #4136gil.rs
feature gate deprecated APIs forGILPool
#4181impl_/deprecations.rs
feature gate APIs usinginto_gil_ref
(Part 2) #4166instance.rs
feature gate deprecated APIs forPy
#4142marker.rs
feature gate APIs usinginto_gil_ref
(Part 1) #4160 feature gate APIs usinginto_gil_ref
(Part 2) #4166 feature gate deprecated more APIs forPy
#4169 feature gateas/into_gil_ref
APIs (Part 3) #4172 feature gate deprecated APIs forPython
#4173marshal.rs
feature gate deprecated APIs formarshal
#4149pycell.rs
split more impl blocks (preparation ofPyCell
feature gate) #4175 feature gatePyCell
#4177type_object.rs
feature gate deprecated APIs forPyType
,PyTypeInfo
andPySuper
#4134types/any.rs
(Tests) portPyAny
tests toBound
API #4140types/boolobject.rs
feature gate deprecated APIs forPyBool
#4159types/bytearray.rs
feature gate deprecated APIs forPyBytes
andPyPyByteArray
#4131types/bytes.rs
feature gate deprecated APIs forPyBytes
andPyPyByteArray
#4131types/capsule.rs
feature gate deprecated APIs forPyCapsule
#4112types/complex.rs
feature gate deprecated APIs forPyFloat
andPyComplex
#4145types/datetime.rs
feature gate deprecated APIs fordatetime
types #4111types/dict.rs
feature gate deprecated APIs forPyDict
#4108types/ellipsis.rs
feature gate deprecated APIs forPyEllipsis
,PyNone
andPyNotImplemented
#4132types/float.rs
feature gate deprecated APIs forPyFloat
andPyComplex
#4145types/frozenset.rs
feature gate deprecated APIs forPyFrozenSet
#4118types/function.rs
feature gate deprecated APIs forPyCFunction
#4154types/iterators.rs
feature gate deprecated APIs forPyIterator
#4119types/list.rs
feature gate deprecated APIs forPyList
#4127types/memoryview.rs
feature gate deprecated APIs forPyMemoryView
#4152types/module.rs
feature gate deprecated APIs forPyModule
#4151types/none.rs
feature gate deprecated APIs forPyEllipsis
,PyNone
andPyNotImplemented
#4132types/notimplemented.rs
feature gate deprecated APIs forPyEllipsis
,PyNone
andPyNotImplemented
#4132types/pysuper.rs
feature gate deprecated APIs forPyType
,PyTypeInfo
andPySuper
#4134types/sequence.rs
(Tests) portPySequence
tests toBound
API #4139types/set.rs
feature gate deprecated APIs forPySet
#4096types/slice.rs
feature gate deprecated APIs forPySlice
#4141types/string.rs
feature gate deprecated APIs forPyString
#4101types/tuple.rs
feature gate deprecated APIs forPyTuple
#4107types/typeobject.rs
feature gate deprecated APIs forPyType
,PyTypeInfo
andPySuper
#4134Remove default implementation of
FromPyObject::extract_bound
(to force users to implement it). feature gateas/into_gil_ref
APIs (Part 3) #4172To get 0.21 out the door I left several test suites with
#[allow(deprecated)]
or#[cfg_attr(not(feature = "gil-refs"), allow(deprecated)]
. We'll need to update these. I like to keep coverage high but I think for sake of practicality I'm ok if we migrate all the tests to the bound API and trust the GIL Refs API is correct by virtue of being implemented on top of the Bound API.Update documentation on
Python
typeFor 0.23
_bound
variants likePyTuple::new_bound
:PyTuple::new
again.PyTuple::new_bound
to nudge users to the plain versions again.Optional polishing tasks from #3684
PyModuleMethods
to move functionality related to creating / building new modules into aPyModuleBuilder
? implementPyModuleMethods
#3703 (comment)IntoPy<Py<T>> for Bound<'_, T>
? implementPyTupleMethods
#3681 (comment)Borrowed<'py, 'py, T>::into_gil_ref
become public API as well?FromPyObject
could gain a lifetime'a
to its argument&'a Bound<'py>
, allowing:Bound
to allowimpl FromPyObject for &Bound
impl FromPyObject<'a, '_> for &'a str
without the pool; as the lifetime of the string borrow depends on the lifetime of the input, not the GIL lifetimePyRef
andPyRefMut
to store&'a Bound<'py, T>
(or borrowed) and avoid reference count overheadpy.None()
,py.Ellipsis()
andpy.NotImplemented()
to returnBorrowed<'py, 'py, PyNone>
(etc.)#[pyo3(from_py_with = "PyAnyMethods::len")]
(and similar)The text was updated successfully, but these errors were encountered: