click icon indicating copy to clipboard operation
click copied to clipboard

Parameter typing improvements

Open AndreasBackx opened this issue 1 year ago • 1 comments

This removes all of the type: ignore mentions in Argument, its subclasses, and the exceptions module. To do so, the following is done:

  1. Parameter is now an abstract base class. This just clarifies it cannot be instantiated which was always the point.
  2. Parameter.name can no longer be None. It only ever is None when expose_value = False. Instead of having to deal with None and is None everywhere, let's just use "" instead of None when expose_value is False
  3. ctx in Parameter.get_error_hint can be None. It always has been like this, but wasn't explicit in typing. Better to be explicit than implicit.
  • ~~Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.~~
    • Parameter.name is an implementation detail, it's not in the documentation.
  • ~~Add or update relevant docs, in the docs folder and in code.~~
  • [x] Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • [x] Add .. versionchanged:: entries in any relevant code docs.

AndreasBackx avatar Nov 09 '24 17:11 AndreasBackx

@AndreasBackx Would you mind rebasing this so it can go out with 8.3.0?

Rowlando13 avatar Aug 23 '25 07:08 Rowlando13