8000 TYP: Signatures are missing default values · Issue #28428 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
TYP: Signatures are missing default values #28428
Open
@Andrej730

Description

@Andrej730

Describe the issue:

E.g. resize is using ... as a default value instead of False.
Not sure if default arguments have any value for running static type check on the code, but having them at hand is very convenient when reading/writing code.

numpy/numpy/__init__.pyi

Lines 2206 to 2209 in 9a2b8b4

@overload
def resize(self, new_shape: _ShapeLike, /, *, refcheck: builtins.bool = ...) -> None: ...
@overload
def resize(self, *new_shape: SupportsIndex, refcheck: builtins.bool = ...) -> None: ...

Image

Reproduce the code example:

import numpy as np

x = np.ones(3)
# Hover over `.resize`.
x.resize(6)

Python and NumPy Versions:

2.2.3
3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]

Type-checker version and settings:

ms-python.vscode-pylance 2025.2.103

Additional typing packages.

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0