pyrefly doesn't understand generic parameter of pint.Quantity
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 519
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
Concerning this package: https://pypi.org/project/Pint/
Code:
```
from typing import *
from pint import Quantity
Rate = NewType("Rate", Quantity[float])
def f(x: Quantity[float]) -> None:
pass
```
Error:
```
ERROR Second argument to NewType is invalid [invalid-argument]
--> main.py:4:24
|
4 | Rate = NewType("Rate", Quantity[float])
| ^^^^^^^^^^^^^^^
|
ERROR `float` is not assignable to upper bound `PlainQuantity[Unknown]` of type variable `QuantityT` [bad-specialization]
--> main.py:6:10
|
6 | def f(x: Quantity[float]) -> None:
| ^^^^^^^^^^^^^^^
|
INFO 2 errors
```
Docs: https://pint.readthedocs.io/en/0.25.2/advanced/typing.html
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.