Skip to content

Conversation

hynek
Copy link
Member

@hynek hynek commented Jul 31, 2025

ref #602

This is for now just private and the impact zone is limited. But I'm confident it can help us to simplify a bunch of code.

I'm especially rather unhappy with the weird entanglement of _ClassBuilder that doesn't really have a clear purpose (anymore?).

But let's talk in general first!

@hynek hynek force-pushed the params branch 3 times, most recently from 2541864 to af0f118 Compare August 1, 2025 04:56
@hynek hynek changed the title Implement _AttrsParams Expose effective class construction params Aug 1, 2025
@hynek hynek force-pushed the params branch 5 times, most recently from 470e2eb to 1edde23 Compare August 10, 2025 07:53
is_slotted: bool
has_weakref_slot: bool
is_frozen: bool
is_kw_only: bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we combine these flags? We can't have force_kw_only without is_kw_only right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct… so another Enum?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I use literals for this in cattrs but that might be too modern for your tastes ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to give hash the same treatment - cache_hash doesn't make sense if hash is false. So the enum might be expanded with HASHABLE_CACHED?

match_args: bool
str: bool
getstate_setstate: bool
on_setattr: Callable[[str, Any], Any]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these Callables be optional?

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.

2 participants