Skip to content

PyWeakref_GetObject removed in Python 3.15#2729

Merged
Avasam merged 1 commit intomhammond:mainfrom
Avasam:PyWeakref_GetObject-removed-in-3.15
Apr 13, 2026
Merged

PyWeakref_GetObject removed in Python 3.15#2729
Avasam merged 1 commit intomhammond:mainfrom
Avasam:PyWeakref_GetObject-removed-in-3.15

Conversation

@Avasam
Copy link
Copy Markdown
Collaborator

@Avasam Avasam commented Apr 8, 2026

Addresses a 3.15 Python C API Removal listed in #2588

My understanding is that PyWeakref_GetRef creates and sets a strong reference that needs to be handled explicitly.

There's a comment alluding that this could maybe be handled differently, but I'm just trying to get the build and tests passing:

// A "map" of weak-references to Python objects. Now we use weakrefs
// this really should be a regular Python dict...
CMapPtrToPtr map;

@Avasam Avasam changed the title PyWeakref_GetObject removed in 3.15 PyWeakref_GetObject removed in 3.15 Apr 8, 2026
@Avasam Avasam force-pushed the PyWeakref_GetObject-removed-in-3.15 branch from 2af8b19 to 5b9c7d0 Compare April 8, 2026 21:48
@Avasam Avasam force-pushed the PyWeakref_GetObject-removed-in-3.15 branch from 5b9c7d0 to f5f85ad Compare April 8, 2026 22:18
@Avasam Avasam requested review from geppi and mhammond April 8, 2026 22:42
@Avasam Avasam changed the title PyWeakref_GetObject removed in 3.15 PyWeakref_GetObject removed in Python 3.15 Apr 8, 2026
@geppi
Copy link
Copy Markdown
Collaborator

geppi commented Apr 11, 2026

Looks good to me.

@Avasam Avasam merged commit d870331 into mhammond:main Apr 13, 2026
28 checks passed
@Avasam Avasam deleted the PyWeakref_GetObject-removed-in-3.15 branch April 13, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants