Skip to content

Conversation

@AndreasBackx
Copy link
Collaborator

@AndreasBackx AndreasBackx commented Nov 9, 2024

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.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.

return value, args

def get_help_record(self, ctx: Context) -> tuple[str, str] | None:
pass
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter complains about not having an implementation when it's an abstract base class. Using return None makes it not do that.

@AndreasBackx AndreasBackx marked this pull request as ready for review November 9, 2024 17:33
@Rowlando13 Rowlando13 added this to the 8.2.1 milestone May 10, 2025
@davidism davidism modified the milestones: 8.2.1, 8.2.2 May 14, 2025
@Rowlando13 Rowlando13 modified the milestones: 8.2.2, 8.2.3 Jul 16, 2025
@Rowlando13 Rowlando13 removed this from the 8.2.3 milestone Aug 3, 2025
@Rowlando13
Copy link
Collaborator

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

@Rowlando13 Rowlando13 marked this pull request as draft August 23, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants