Commit 8b74278
authored
fix: Improve
* Improve `Accept.best_match` typing
It used to be this way:
```python
.best_match(['application/json'], default='application/json')
# -> reveals `Optional[str]` as the return type
```
However, default is `str` and this is a typing error.
Now it works as expected when passing `best_match(['application/json'], default='application/json')` and reveals `str` as the return type. Full testing is here: https://mypy-play.net/?mypy=latest&python=3.12&flags=strict&gist=bf3a081c25f31ddfd2da6614fb59deff
* Update headers.py
* Update headers.py
* Update headers.pyAccept.best_match typing (#4487)1 parent bcea856 commit 8b74278
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
443 | 450 | | |
444 | 451 | | |
445 | 452 | | |
| |||
0 commit comments