-
Notifications
You must be signed in to change notification settings - Fork 936
Closed
Description
This is a tracking issue for #3382
PRs currently waiting for review (all input is greatly appreciated, doesn't need to be an existing maintainer):
TODO (this list is a fairly good coverage of all PRs which occurred for the Bound implementation, but it is probably not complete):
- Make all of the types and method traits public API
-
What to do with constructors e.g.We have decided we will introducePyTuple::newwhich return gil refs?new_boundvariants of these constructors in 0.21 and let migration be incremental over a few release cycles, eventually changingPyTuple::newetc. in maybe 0.23.
-
- Headline entry in migration guide
- Rename
Py2->BoundandPy2Borrowed->Borrowed- make Bound and Borrowed types public API #3686 - Finish implementation of all
PyXMethodstraits for types which have&selfmethods-
PyCapsuleMethods- implementPyCapsuleMethods#3770 -
PyComplexMethods- implementPyComplexMethods#3767 -
datetimetypes - implement datetime traits forBound#3679 -
PyFrozenSetMethods- implementPySetMethodsandPyFrozenSetMethods#3694 -
PyModuleMethods- implementPyModuleMethods#3703 -
PySetMethods- implementPySetMethodsandPyFrozenSetMethods#3694 -
PySliceMethods- implementPyTracebackMethodsandPySliceMethods#3763 -
PyTracebackMethods- implementPyTracebackMethodsandPySliceMethods#3763 -
PyTupleMethods- implementPyTupleMethods#3681 -
PyTypeMethods- implementPyTypeMethods#3705
-
- Add
Boundconstructor variants to all Python types, and also_boundmethod variants where applicable (this list is not exhaustive, will add as things are found).-
PyComplex- portPyComplex::from_complextoBoundAPI #3866 -
datetimetypes - add_boundconstructors for datetime types #3778 -
Python(lots of methods) -
dictconstructors - deprecatePyDict::newconstructor #3823 -
PyEllipsis- PyEllipsis and PyNotImplemented new get_bound api #3797 -
PyCFunction/PyFunction- PyCFunction bound api #3800 -
PyNotImplemented- PyEllipsis and PyNotImplemented new get_bound api #3797 -
PyModuleconstructors - addPyModule::new_boundandPyModule::import_bound#3775 -
PyType- implementPyTypeMethods#3705 -
PyBuffer::get- convertPyBuffertoBoundAPI #3836 -
pyo3::marshaldumps / loads - convertmarshaltoBoundAPI #3796 -
PyTypeInfomethods - addboundmethod variants forPyTypeInfo#3782 -
PyErr::from_type,PyErr::valueetc. (lots of methods ofPyErrneed updating) -
PyUnicodeDecodeErrorconstructors
-
- Move
FromPyObjectto take&Bound<'py, PyAny>instead of&'py PyAny- Initial solution proposed in Add
extract_boundmethod to FromPyObject #3706 - Go through PyO3's codebase and replace
fn extractwithfn extract_boundforFromPyObjectimplementations - migrate manyFromPyObjectimplementations toBoundAPI #3784 -
FromPyObjectfor&str,Cow<[u8]>and&[u8]- addFromPyObjectBoundtrait for extracting&strwithout GIL Refs #3928 -
#[derive(FromPyObject)]proc macro needs generated output updated - update#[derive(FromPyObject)]to useextract_bound#3828
- Initial solution proposed in Add
- Make
Bound<T>the replacement for&PyCell<T>.- Add
#[pyclass]accessors like.borrow(),borrow_mut()toBound<'_, T: PyClass>- pyclass methods forBound#3792 - Remove
&PyCellmember from internals ofPyRefandPyRefMut- storeBound<T>insidePyRefandPyRefMut#3860 - Remove uses of
PyCellfrom proc macro code (#[pymethods]method receivers) - allowBound<'_, T>in #[pymethods]selfposition #3896 - Deprecate
PyCell::new- deprecatePyCell::newin favor ofPy::neworBound::new#3872 - Deprecate
PyCell<T>as a user-facing type - deprecate the use ofPyCellin favor ofBoundandPy#3916
- Add
- Replacing internal gil-ref uses with new API - with
as_ref,into_ref- With deprecation of most ways to produce a gil-ref, this seems good to me now.
-
UpdateFor now I just reverted Change return types ofpy.None(),py.Ellipsis()andpy.NotImplemented()to returnBorrowed<'py, 'py, PyNone>(etc.)py.None(),py.NotImplemented()andpy.Ellipsis()to typed singletons #3578 in Revert "Merge pull request #3578 from davidhewitt/typed-helpers" #3794, to make this problem go away, will add to the polish list instead. - Other proc macro functionality using GIL Refs:
-
#[classmethod]and#[pyfunction(pass_module)]- supportBoundforclassmethodandpass_module#3831 - Allow
#[pymodule]macro to take&Bound<'py, PyModule>as the argument. Pymodule bound #3897 -
#[pyo3(from_py_with)]on function arguments - allowfrom_py_withon function args to take afn(&Bound) -> PyResult#3837 -
#[pyfunction]argument processing - updateextract_argumentto use Bound APIs #3708
-
- Further deprecations to nudge users off the GIL Refs API
- Deprecate
Py::as_ref- deprecate Py::as_ref #3864 - Deprecate
Py::into_ref- Deprecate Py::into_ref #3867 - Deprecate
Python::from_owned_ptrmethods - Deprecatepy.from_owned_ptrmethods #3875 - Deprecate
Python::from_borrowed_ptrmethods - deprecatefrom_borrowed_ptrmethods #3915 - Deprecate taking GIL Refs as function arguments, if possible - deprecate GIL refs in function argument #3847
- Deprecate
&PyModulein#[pymodule]- deprecate&PyModuleas#[pymodule]argument type #3936 - Deprecate
&PyModulein#[pyfunction(pass_module)]- deprecate gil-refs in "self" position #3943 - Deprecate
&PyAnyin#[pyo3(from_py_with)]- deprecate gil-refs infrom_py_with#3967, deprecate gil-refs infrom_py_with(Part 2) #3972 - Deprecate
wrap_pyfunction!(foo, py)towrap_pyfunction_bound!(foo, py)(just for thePythonsecond argument) -
Decide whether we continue to test this huge volume of deprecated APIs- I think for now I'm not bothering to remove tests which operate on GIL Refs. It's quite possible that when we deprecate the feature we end up with a bit of temporary deprecation, but overall if some of the GIL Ref APIs miss coverage it won't be a huge problem if they are basically all just wrappers around theBoundAPI.
- Deprecate
- Update
types.mddocumentation forBound<T>- docs: major rewrite for Bound API #3906- Mention that cloning
Bound<T>is cheap / shallow.
- Mention that cloning
- Final scan over documentation before release to catch as much outdated stuff as possible.
- Expose
PyAnyMethodsetc traits on a path other thanpyo3::prelude- reexportPyAnyMethodsand friends frompyo3::types#3895 - Check
Derefimplementation forBound<T>works forBound<T: PyClass>- fixAsRefandDerefimpls onBound<T>#3879
Possible polish to consider later: Moved to #3960
I'll try to keep this updated as we go, and probably there are items which I've missed right now.
If anyone wants to claim any of these unassigned tasks, please ping here and I'll update this so that we don't race.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels