Skip to content

Annotations don't import np.lib.* #18601

@bmerry

Description

@bmerry

When one imports numpy, the various np.lib.* modules are automatically imported. However, the type annotations don't reflect this.

Reproducing code example:

import numpy as np
np.lib.stride_tricks.DummyArray```

### Error message:

When run with mypy 0.790:

st.py:2: error: Module has no attribute "stride_tricks"
Found 1 error in 1 file (checked 1 source file)


### NumPy/Python version information:

1.20.1 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0]

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