jquast / blessed

Blessed is an easy, practical library for making python terminal apps
http://pypi.python.org/pypi/blessed
MIT License
1.2k stars 72 forks source link

Fixes for Pylint 2.14 and minor tweaks #242

Closed avylove closed 2 years ago

avylove commented 2 years ago

Pylint 2.14 The main thing here is changing width.__index__() to int(width). Pylint complained about the use of a dunder method and as I dug into it, using int() is more correct since it will support all the magic methods for coercion to an integer (__int__(), __trunc__(), etc). The test is explicitly for __index__() which exists in older Python versions, but is not invoked by int() until 3.8, so I limited the test to newer versions.

Code Tweaks Pretty much all of these are getting rid of redundant syntax

codecov[bot] commented 2 years ago

Codecov Report

Base: 95.36% // Head: 95.50% // Increases project coverage by +0.14% :tada:

Coverage data is based on head (e1f94b2) compared to base (06a8d2e). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #242 +/- ## ========================================== + Coverage 95.36% 95.50% +0.14% ========================================== Files 9 8 -1 Lines 1013 1002 -11 Branches 177 174 -3 ========================================== - Hits 966 957 -9 + Misses 43 42 -1 + Partials 4 3 -1 ``` | [Impacted Files](https://codecov.io/gh/jquast/blessed/pull/242?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast) | Coverage Δ | | |---|---|---| | [blessed/colorspace.py](https://codecov.io/gh/jquast/blessed/pull/242/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast#diff-Ymxlc3NlZC9jb2xvcnNwYWNlLnB5) | `100.00% <100.00%> (ø)` | | | [blessed/formatters.py](https://codecov.io/gh/jquast/blessed/pull/242/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast#diff-Ymxlc3NlZC9mb3JtYXR0ZXJzLnB5) | `100.00% <100.00%> (ø)` | | | [blessed/sequences.py](https://codecov.io/gh/jquast/blessed/pull/242/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast#diff-Ymxlc3NlZC9zZXF1ZW5jZXMucHk=) | `100.00% <100.00%> (ø)` | | | [blessed/terminal.py](https://codecov.io/gh/jquast/blessed/pull/242/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast#diff-Ymxlc3NlZC90ZXJtaW5hbC5weQ==) | `98.24% <100.00%> (ø)` | | | [blessed/\_\_init\_\_.py](https://codecov.io/gh/jquast/blessed/pull/242/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast#diff-Ymxlc3NlZC9fX2luaXRfXy5weQ==) | | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeff+Quast)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.