cpython/Tools/clinic
Alex Waygood 1c55e8d007
gh-104050: Improve some typing around `default`s and sentinel values (#104626)
- Convert `unspecified` and `unknown` to be members of a `Sentinels` enum, rather than instances of bespoke classes.
  - An enum feels more idiomatic here, and works better with type checkers.
  - Convert some `==` and `!=` checks for these values to identity checks, which are more idiomatic with sentinels.
  - _Don't_ do the same for `Null`, as this needs to be a distinct type due to its usage in `clinic.py`.
- Use `object` as the annotation for `default` across `clinic.py`. `default` can be literally any object, so `object` is the correct annotation here.

---

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-18 21:58:42 +00:00
..
clinic.py gh-104050: Improve some typing around `default`s and sentinel values (#104626) 2023-05-18 21:58:42 +00:00
cpp.py gh-104050: Add more annotations to `Tools/clinic.py` (#104544) 2023-05-16 17:18:28 +00:00
mypy.ini gh-104050: Add more annotations to `Tools/clinic.py` (#104544) 2023-05-16 17:18:28 +00:00
requirements-dev.txt Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (#104501) 2023-05-15 09:17:48 +00:00