Skip to content

Use ParamSpec to improve typing for actor parameters - #388

Merged
shsms merged 2 commits into
frequenz-floss:v0.x.xfrom
shsms:actor-typing
May 19, 2023
Merged

Use ParamSpec to improve typing for actor parameters#388
shsms merged 2 commits into
frequenz-floss:v0.x.xfrom
shsms:actor-typing

Conversation

@shsms

@shsms shsms commented May 15, 2023

Copy link
Copy Markdown
Contributor

This allows better type-checking my mypy, and better completions for actor parameters, from pyright/LSP.

shsms added 2 commits May 15, 2023 16:27
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Previously, the actor decorator was returning `typing.Any` objects.

This commit introduces a `ParamSpec` and a `TypeVar`, to improve
typing of actor params, and returned type.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@shsms shsms added this to the v0.21.0 milestone May 15, 2023
@shsms shsms self-assigned this May 15, 2023
@shsms
shsms requested a review from a team as a code owner May 15, 2023 14:33
@shsms
shsms requested a review from Marenz May 15, 2023 14:33
@github-actions github-actions Bot added the part:actor Affects an actor ot the actors utilities (decorator, etc.) label May 15, 2023
@shsms
shsms added this pull request to the merge queue May 19, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit c28afa1 May 19, 2023
@shsms
shsms deleted the actor-typing branch May 19, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:actor Affects an actor ot the actors utilities (decorator, etc.)

Projects

Development

Successfully merging this pull request may close these issues.

2 participants