Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit cd3ecc5

Browse files
committed
demonstrate that python/mypy#19001 fixes this issue
1 parent 61c0e70 commit cd3ecc5

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,19 @@ $ pyright .
108108

109109
---
110110

111-
### Mypy (without NumType)
111+
### Mypy `2.2.5` (without NumType)
112112

113113
NumType: No
114114

115115
```bash
116116
$ rm -rf .mypy_cache
117117
$ mypy .
118118
main.pyi:3: note: Revealed type is "numpy.bool[Literal[True]]"
119-
Success: no issues found in 1 source file
120119
```
121120

122121
`numpy.bool` => NumPy's bundled stubs are used :white_check_mark:
123122

124-
### Mypy (with NumType)
123+
### Mypy `2.2.5` (with NumType)
125124

126125
```bash
127126
$ rm -rf .mypy_cache
@@ -131,6 +130,22 @@ main.pyi:3: note: Revealed type is "numpy.bool[Literal[True]]"
131130

132131
`numpy.bool` => NumPy's bundled stubs are used :x:
133132

133+
### Mypy (`jorenham:fix-18997`) (with NumType)
134+
135+
Install the PR branch with the fix (python/mypy#19001):
136+
137+
```bash
138+
uv pip install "git+https://github.com/jorenham/mypy@fix-18997"
139+
```
140+
141+
```bash
142+
$ rm -rf .mypy_cache
143+
$ mypy main.pyi
144+
main.pyi:3: note: Revealed type is "numpy.bool_[Literal[True]]"
145+
```
146+
147+
`numpy.bool_` => NumType's `numpy-stubs` are used :white_check_mark:
148+
134149
## The nuclear workaround
135150

136151
<details>

0 commit comments

Comments
 (0)