Skip to content

Conversation

@eliegoudout
Copy link
Owner

@eliegoudout eliegoudout commented Jun 8, 2025

Fixes mismatch between __signature__ property and actual behaviour.
Now runtime behaviour matches __signature__.

Example:

>>> class A(ParamClass):
...     x: int = 0
...     @classmethod
...     def __post_init__(cls, y: int, /) -> None:
...         print(cls.x + y)
...
>>> signature(A)
<Signature (post_init_args=[], /, *, x: int = 0)>
>>> A([0], x=1)
0
A(x=1)

Closes #39.

@eliegoudout eliegoudout merged commit 3b5211a into main Jul 18, 2025
15 checks passed
@eliegoudout eliegoudout deleted the 39-fix-signature-post-init branch July 18, 2025 18:09
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.

Wrong __signature__ with __post_init__

2 participants