Skip to content

Commit a155e42

Browse files
jenshnielsenCopilot
andcommitted
Fix mypy: remove ParameterBaseKWArgs inheritance from ParameterKWArgs
ParameterKWArgs redeclares all ParameterBaseKWArgs fields so that Sphinx can discover and document them. Mypy does not allow overwriting TypedDict fields when extending, so the fix is to remove the inheritance and have ParameterKWArgs be a standalone TypedDict that includes all fields directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 64753b9 commit a155e42

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/qcodes/parameters/parameter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from types import MethodType
99
from typing import TYPE_CHECKING, Any, Generic, Literal
1010

11+
from typing_extensions import TypedDict
12+
1113
from .command import Command
1214
from .parameter_base import (
1315
InstrumentTypeVar_co,
@@ -33,7 +35,7 @@
3335

3436

3537
class ParameterKWArgs(
36-
ParameterBaseKWArgs[ParameterDataTypeVar, InstrumentTypeVar_co],
38+
TypedDict,
3739
Generic[ParameterDataTypeVar, InstrumentTypeVar_co],
3840
):
3941
"""
@@ -46,7 +48,7 @@ class ParameterKWArgs(
4648
defined here.
4749
"""
4850

49-
# Members inherited from ParameterBaseKWArgs are redeclared here
51+
# Members from ParameterBaseKWArgs are redeclared here
5052
# so that Sphinx can discover and document them.
5153
instrument: NotRequired[InstrumentTypeVar_co]
5254
"""

0 commit comments

Comments
 (0)