Skip to content

Use ParamSpec for shared kwargs #2321

Open
@sentrivana

Description

@sentrivana

Problem Statement

We have a couple of hacks in place in the SDK (e.g. here) to enable autocompletion for things that share args/kwargs without having to duplicate said args/kwargs in multiple places.

Solution Brainstorm

Python 3.10 (and typing_extensions for lower Python versions) includes support for ParamSpec https://sobolevn.me/2021/12/paramspec-guide that allows type signatures to "share" args/kwargs between functions. See if we can use this to replace the existing hacks.

Make sure that you get proper typing hints in an IDE (best to check both e.g. VSCode and PyCharm) and that the API docs are also correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: DXDealing with developer experienceImprovementPythonSDKTriagedHas been looked at recently during old issue triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions