Skip to content

[2026/spec]: improve type hints#83

Open
LoicRiegel wants to merge 1 commit into
ArjanCodes:mainfrom
LoicRiegel:main
Open

[2026/spec]: improve type hints#83
LoicRiegel wants to merge 1 commit into
ArjanCodes:mainfrom
LoicRiegel:main

Conversation

@LoicRiegel

Copy link
Copy Markdown

Inspired by this great YouTube comment and its replies.

What changed

  • used from __future__ import annotations because Predicate type hint is used inside Predicate class
  • Improved typing around rule definitions and factories using ParamSpec and Concatenate
  • Changed the order of parameters in the rule functions. Function parameter order was standardized to subject first, then extra parameters because Concatenate only supports prepending fixed parameters before ParamSpec, not appending after it.

Hope it can help other viewers :)

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.

1 participant