Fix the type annotation for color
param of Spinner.finalize()
#2879
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Colorama's ANSI class attributes are defined as ints. However, when an ANSI class is instantiated (say, when the
AnsiFore
class is instantiated asFore
), instance attributes with identical names are dynamically created, but the attributes are strings containing ANSI escape sequences.Thus,
AnsiFore.YELLOW
is an int, whileFore.YELLOW
is a str. mypy 0.991 isn't catching this discrepancy, but PyCharm did.Closes #2878.
Thanks for contribution
Please, make sure you address all the checklists (for details on how see
development documentation)!
ran the linter to address style issues (
tox -e fix
)wrote descriptive pull request text
ensured there are test(s) validating the fix
mypy didn't notice a problem before or after the fix, so I don't see a way to test this.
added news fragment in
docs/changelog
folderupdated/extended the documentation
This doesn't seem necessary for this type of change. Please correct me if I'm wrong!