Uninett / zino

Zino 2.0 - Network state monitor for research networks
Apache License 2.0
3 stars 5 forks source link

Define and use a `TypeVar` for `Event` classes #276

Closed lunkwill42 closed 3 months ago

lunkwill42 commented 3 months ago

Scope and purpose

Fix slightly incorrect type annotations for event registry functionality.

This is the canonical way to annotate that the return value of a function is an instance of the type that was used as one of the function arguments.

Seems to be the only way to make type checkers understand the real type of the return argument.

This pull request

Contributor Checklist

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 3 months ago

πŸ¦™ MegaLinter status: βœ… SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
βœ… PYTHON black 2 0 0.63s
βœ… PYTHON isort 2 0 0.23s
βœ… PYTHON ruff 2 0 0.01s

See detailed report in MegaLinter reports _Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff_

_MegaLinter is graciously provided by OX Security_

github-actions[bot] commented 3 months ago

Test results

β€‡β€ˆβ€‡β€‡3 filesβ€„β€ƒβ€‡β€ˆβ€‡β€‡3 suites   54s :stopwatch: β€‡β€ˆ404 testsβ€ƒβ€‡β€ˆ404 :white_check_mark: 0 :zzz: 0 :x: 1β€ˆ212 runsβ€Šβ€ƒ1β€ˆ210 :white_check_mark: 2 :zzz: 0 :x:

Results for commit 77509c7f.