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
@hynek hynek force-pushed the params branch 3 times, most recently from 9575cf9 to da90471 Compare September 8, 2025 16:14
@hynek hynek marked this pull request as ready for review September 8, 2025 16:59
@hynek
Copy link
Member Author

hynek commented Sep 8, 2025

@Tinche what did we agree to call the inspect function that extracts the props?

Copy link
Member

@Tinche Tinche left a comment

Choose a reason for hiding this comment

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

LGTM. But where's inspect? :D

@hynek
Copy link
Member Author

hynek commented Sep 23, 2025

Unfortunately, I'm apparently too dumb to make this work with Mypy. So unless someone can help here, I'll just make it private and ship it. The refactoring are worth it on their own.

@hynek
Copy link
Member Author

hynek commented Sep 28, 2025

Some more hours wasted later, I got it working by using our internal stuff to create classes and not using enums in the type hints.

It seems like any type of type hint triggers Mypy to look at our code which ends in disaster. This also means there's probably no gradual way to make the code base fully typed. :(


please final review and merge @Tinche – 25.4.0 will follow ASAP

please also look at https://attrs--1454.org.readthedocs.build/en/1454/api.html#attrs.inspect

@hynek
Copy link
Member Author

hynek commented Sep 28, 2025

(I have changed some of the field names to make them more idiomatic – super open for better ones)

@hynek hynek changed the title Expose effective class construction params Expose effective class construction properties Sep 28, 2025
@hynek hynek added this pull request to the merge queue Sep 30, 2025
Merged via the queue into main with commit 112dd1d Sep 30, 2025
19 checks passed
@hynek hynek deleted the params branch September 30, 2025 08:59
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