Skip to content
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

Add weakref Python types #3835

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cb75d28
Add vscode folder to gitignore
SuperJappie08 Feb 8, 2024
da6fa21
Initial work on PyWeakRef (weakref.ReferenceType)
SuperJappie08 Feb 8, 2024
f84d6d2
Add documentation for PyWeakRef::upgrade
SuperJappie08 Feb 8, 2024
b696f33
Add missing docs for PyWeakRef
SuperJappie08 Feb 9, 2024
880fab7
Add PyWeakProxy
SuperJappie08 Feb 9, 2024
62616a0
Add PyWeakCallableProxy
SuperJappie08 Feb 9, 2024
123077b
Merge branch 'PyO3:main' into weakref
SuperJappie08 Feb 9, 2024
0d5667b
Add PyWeakRefMethods::upgrade_exact and prevent unnecessary panicing
SuperJappie08 Feb 9, 2024
5508d3a
Change PyWeakRefMethods to exclude infeasible errors.
SuperJappie08 Feb 9, 2024
f18ba78
Add towncrier changes
SuperJappie08 Feb 14, 2024
b5fb139
Merge branch 'PyO3:main' into weakref
SuperJappie08 Feb 14, 2024
ee95efb
Update weakref type doctests to use `py.run_bound`
SuperJappie08 Feb 14, 2024
d28da4e
Fix to adhere to MSRV
SuperJappie08 Feb 15, 2024
dff0914
Make weakref tests independent from macros feature
SuperJappie08 Feb 15, 2024
e06e383
Change Weakref tests
SuperJappie08 Feb 15, 2024
f140841
Remove forgotten Debug marcos
SuperJappie08 Feb 22, 2024
cd056af
Processed .gitignore and PyResultExt feedback
SuperJappie08 Mar 8, 2024
130c800
Change new methods of weakref types to remove dangling pointers
SuperJappie08 Mar 8, 2024
0b097fc
Merge branch 'main' into weakref
SuperJappie08 Mar 8, 2024
dd3ad8e
Change to reflect deprecation of PyErr::value for PyErr::value_bound
SuperJappie08 Mar 8, 2024
efdd0ff
Change Tests so different class name in older python versions is acco…
SuperJappie08 Mar 8, 2024
972c168
Change formatting
SuperJappie08 Mar 8, 2024
30c4742
Make tests ABI3 compatible
SuperJappie08 Mar 8, 2024
3cc55c9
Prevent the use of PyClass in test for weakref under abi3 Python 3.7 …
SuperJappie08 Mar 11, 2024
a570f00
Disable weakref types when targeting PyPy
SuperJappie08 Mar 12, 2024
dc40185
Remove needless borrow from CallableProxy test
SuperJappie08 Mar 12, 2024
513ab14
Add Borrowed variants of upgrade and upgrade exact to trait
SuperJappie08 Mar 12, 2024
1ad66e8
Added tests for weakref borrow_upgrade methods
SuperJappie08 Mar 12, 2024
ede188a
Change PyWeakRefMethods method names to be more consistent
SuperJappie08 Mar 12, 2024
4a0a0a9
Change weakref constructors to take PyAny for main target
SuperJappie08 Mar 12, 2024
f2404e0
Add track_caller to all panicing weakref methods
SuperJappie08 Mar 15, 2024
3778161
Add PyWeakRefMethods::upgrade*_as_unchecked
SuperJappie08 Mar 25, 2024
b4007bd
Fix PyWeakProxy and PyWeakCallableProxy Documentation
SuperJappie08 Mar 25, 2024
6f2aaf1
Replace deprecated wrap_pyfunction with bound equivalent
SuperJappie08 Mar 25, 2024
142ab29
Merge branch 'PyO3:main' into weakref
SuperJappie08 Mar 28, 2024
a45c043
Add (Generic) PyWeakref Type
SuperJappie08 Apr 5, 2024
da776ed
Reworked Proxy types into one (PyWeakrefProxy)
SuperJappie08 Apr 5, 2024
d1bf16c
Rename PyWeakRef to PyWeakrefReference
SuperJappie08 Apr 5, 2024
97d73e9
Merge branch 'PyO3:main' into weakref
SuperJappie08 Apr 18, 2024
c7ab375
Change PyWeakrefReference to only use type pointer when it exists
SuperJappie08 Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/3835.added.md
@@ -0,0 +1 @@
Add `PyWeakRef`, `PyWeakProxy` and `PyWeakCallableProxy`.
2 changes: 2 additions & 0 deletions src/prelude.rs
Expand Up @@ -46,3 +46,5 @@ pub use crate::types::string::PyStringMethods;
pub use crate::types::traceback::PyTracebackMethods;
pub use crate::types::tuple::PyTupleMethods;
pub use crate::types::typeobject::PyTypeMethods;
#[cfg(not(PyPy))]
pub use crate::types::weakref::PyWeakRefMethods;
4 changes: 4 additions & 0 deletions src/types/mod.rs
Expand Up @@ -47,6 +47,8 @@ pub use self::string::{PyString, PyString as PyUnicode, PyStringMethods};
pub use self::traceback::{PyTraceback, PyTracebackMethods};
pub use self::tuple::{PyTuple, PyTupleMethods};
pub use self::typeobject::{PyType, PyTypeMethods};
#[cfg(not(PyPy))]
pub use self::weakref::{PyWeakCallableProxy, PyWeakProxy, PyWeakRef, PyWeakRefMethods};

/// Iteration over Python collections.
///
Expand Down Expand Up @@ -357,3 +359,5 @@ pub(crate) mod string;
pub(crate) mod traceback;
pub(crate) mod tuple;
pub(crate) mod typeobject;
#[cfg(not(PyPy))]
pub(crate) mod weakref;