Skip to content

Conversation

@FasterSpeeding
Copy link
Collaborator

@FasterSpeeding FasterSpeeding commented Jan 2, 2022

Summary

This uses ParamSpec and Concatenate to partially type signatures which have a set number of positional arguments they must always accept but may by accepting further keyword arguments dynamically (either from DI or command arguments).

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

@FasterSpeeding FasterSpeeding changed the title Improve typing around dependency injection using callbacks Improve typing around callbacks with dynamic keyword-arguments Jan 2, 2022
@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch 5 times, most recently from c9e1556 to 0c64eb5 Compare January 9, 2022 23:34
@FasterSpeeding
Copy link
Collaborator Author

FasterSpeeding commented Jan 10, 2022

TODO:

  • update the relevant doc strings to have more detail on the relevant callback's signature
  • typing extensions bug
  • pyright bugs

@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch 4 times, most recently from 3ba0ed8 to 840aa84 Compare January 13, 2022 17:51
@FasterSpeeding
Copy link
Collaborator Author

Probably gonna want to keep the old public-facing type hints but possibly keep them out of the __all__s?

@FasterSpeeding
Copy link
Collaborator Author

Check usages of hook sigs and CheckSig

@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch from 3054f51 to 2466ecb Compare July 22, 2022 08:54
@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch from 2466ecb to 5cb81dc Compare July 30, 2022 06:16
@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch 2 times, most recently from 014a6ea to 837ec23 Compare August 20, 2022 00:25
@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch 2 times, most recently from 8f77254 to a6c0d66 Compare January 22, 2023 22:24
@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2023

PR Preview Action ddfa7dc4b5f8fa02675fe5da02ae15c9722367f0
Preview removed because the pull request was closed.
2023-01-31 05:25 UTC

@FasterSpeeding
Copy link
Collaborator Author

FasterSpeeding commented Jan 23, 2023

This can't work on 3.9 thx to python/typing_extensions#48 so prob gonna drop support for 3.9 all together found a hack around

@FasterSpeeding FasterSpeeding marked this pull request as ready for review January 23, 2023 04:13
@FasterSpeeding FasterSpeeding mentioned this pull request Jan 23, 2023
2 tasks
@FasterSpeeding FasterSpeeding force-pushed the task/better-callbacks branch 2 times, most recently from a2d89de to fc198dd Compare January 25, 2023 08:04
@FasterSpeeding FasterSpeeding merged commit 942b8b4 into master Jan 31, 2023
@FasterSpeeding FasterSpeeding deleted the task/better-callbacks branch January 31, 2023 05:24
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