Skip to content

Comments

gh-142414: Make value, not identity, matter for UNBOUND* objects#145184

Open
encukou wants to merge 2 commits intopython:mainfrom
encukou:unbound-not-singleton
Open

gh-142414: Make value, not identity, matter for UNBOUND* objects#145184
encukou wants to merge 2 commits intopython:mainfrom
encukou:unbound-not-singleton

Conversation

@encukou
Copy link
Member

@encukou encukou commented Feb 24, 2026

I realize there's a pile of PRs for the issue already,

I couldn't find a reason why the singletons (UNBOUND, UNBOUND_ERROR, UNBOUND_REMOVE) need to be singletons. Each is essentially a name for the underlying int (used in the C layer); plus UNBOUND doubles as the replacement value but that's not the issue here.
I also couldn't find a reason to have different UNBOUND objects in different modules.

This converts them to a normal class, and compares by value rather than identity.

Co-Authored-By: Kir Chou <note351@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant