Skip to content

Add type annotations for instance attributes in exceptions#3453

Open
jorenham wants to merge 3 commits into
pallets:stablefrom
jorenham:typing/exceptions/coverage
Open

Add type annotations for instance attributes in exceptions#3453
jorenham wants to merge 3 commits into
pallets:stablefrom
jorenham:typing/exceptions/coverage

Conversation

@jorenham
Copy link
Copy Markdown
Contributor

Just like #3422 and #3451, this fills in the missing attribute type annotations for the error classes in click.exceptions. This increases type coverage by 0.89% (91.5% -> 92.39%).

Copy link
Copy Markdown
Collaborator

@AndreasBackx AndreasBackx left a comment

Choose a reason for hiding this comment

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

Same as other PRs, good to have. Just remove the version change and like other PR rebase on main instead perhaps?

Comment thread src/click/exceptions.py
self.option_name = option_name
self.possibilities: list[str] | None = None

# this temp variable avoids mypy complaining self.possibilities "reassignment"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fine to remove this.

Comment thread src/click/exceptions.py
self.command_name = command_name
self.possibilities: list[str] | None = None

# this temp variable avoids mypy complaining self.possibilities "reassignment"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as other comment.

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.

5 participants