The arguments attribute of inspect.BoundArguments is of type dict in the stdlib, but typeshed has it annotated as OrderedDict[str, Any]:
Relevant code-blocks from cpython:
Relevant code-block from typeshed:
|
class BoundArguments: |
|
__slots__ = ("arguments", "_signature", "__weakref__") |
|
arguments: OrderedDict[str, Any] |
|
@property |
|
def args(self) -> tuple[Any, ...]: ... |
|
@property |
|
def kwargs(self) -> dict[str, Any]: ... |
|
@property |
|
def signature(self) -> Signature: ... |
|
def __init__(self, signature: Signature, arguments: OrderedDict[str, Any]) -> None: ... |
|
def apply_defaults(self) -> None: ... |
|
def __eq__(self, other: object) -> bool: ... |
|
__hash__: ClassVar[None] # type: ignore[assignment] |
Relevant section of the documentation: https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments
Proposed fix:
- Change
OrderedDict[str, Any] to dict[str, Any] in lines 471 and 478 of inspect.pyi.
- Remove
OrderedDict import from inspect.pyi,
If this is acceptable, I can create a PR implementing these changes.
The
argumentsattribute ofinspect.BoundArgumentsis of typedictin the stdlib, but typeshed has it annotated asOrderedDict[str, Any]:Relevant code-blocks from cpython:
Relevant code-block from typeshed:
typeshed/stdlib/inspect.pyi
Lines 469 to 481 in df45287
Relevant section of the documentation: https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments
Proposed fix:
OrderedDict[str, Any]todict[str, Any]in lines 471 and 478 ofinspect.pyi.OrderedDictimport frominspect.pyi,If this is acceptable, I can create a PR implementing these changes.