Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sgillies
Copy link
Member

@sgillies sgillies commented Dec 28, 2024

Namedtuple is a bit awkward to use and today people would expect Affine to be a modern data class. I tried to use the stdlib's dataclasses at first, but was blocked by the lack of converters.

Will rebase this once #110 is merge.

@sgillies sgillies added this to the 3.0 milestone Dec 28, 2024
@sgillies sgillies self-assigned this Dec 28, 2024
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [attrs]
Copy link
Member Author

Choose a reason for hiding this comment

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

Required to use the attrs mypy plugin.

@sgillies
Copy link
Member Author

@mwtoews what do you think?

Copy link
Contributor

@mwtoews mwtoews left a comment

Choose a reason for hiding this comment

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

Changes look good! I had a look at std dataclasses too, but found the transition not clear-cut. I had a look at refactoring with typing.NamedTuple too (shown here), but this didn't look any better. While I'm not an attrs user, this dependency seems well maintained.

@sgillies sgillies merged commit 4311b82 into main Jan 1, 2025
7 checks passed
@sgillies sgillies deleted the dataclass branch January 1, 2025 15:37
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.

3 participants