python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
5.98k stars 325 forks source link

Add PosArgT typing to trio.run #3022

Closed jakkdl closed 6 days ago

jakkdl commented 1 week ago

I noticed this when going through the trio-typing test suite. I don't see any reason why this would've been intentionally skipped in #2881, so I suspect it just got missed?

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (a7db0e4) to head (945a3b5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3022 +/- ## ======================================= Coverage 99.63% 99.63% ======================================= Files 120 120 Lines 17865 17865 Branches 3216 3216 ======================================= Hits 17800 17800 Misses 46 46 Partials 19 19 ``` | [Files](https://app.codecov.io/gh/python-trio/trio/pull/3022?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio) | Coverage Δ | | |---|---|---| | [src/trio/\_core/\_run.py](https://app.codecov.io/gh/python-trio/trio/pull/3022?src=pr&el=tree&filepath=src%2Ftrio%2F_core%2F_run.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX2NvcmUvX3J1bi5weQ==) | `99.38% <ø> (ø)` | | | [src/trio/\_core/\_tests/test\_run.py](https://app.codecov.io/gh/python-trio/trio/pull/3022?src=pr&el=tree&filepath=src%2Ftrio%2F_core%2F_tests%2Ftest_run.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX2NvcmUvX3Rlc3RzL3Rlc3RfcnVuLnB5) | `100.00% <100.00%> (ø)` | |
jakkdl commented 6 days ago

Looks good to me!

Should we consider moving over some of the trio-typing test suite, since apparently that catches some issues that the trio tests don't?

There's not much that's worth adapting, I don't think we want to adapt their method of running internal mypy functions, so it would consist of copying and adapting the test-data. But we already cover most everything:

The only things left were run, that trio-typing raised a typing error if you tried to instantiate Cancelled, Nursery.start, and some trivial stuff that would raise typechecking errors when we run mypy on our test suite.