Closed avylove closed 2 years ago
Merging #234 (14644ea) into master (1e53577) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #234 +/- ##
=======================================
Coverage 95.36% 95.36%
=======================================
Files 9 9
Lines 1014 1015 +1
Branches 176 176
=======================================
+ Hits 967 968 +1
Misses 43 43
Partials 4 4
Impacted Files | Coverage Δ | |
---|---|---|
blessed/sequences.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1e53577...14644ea. Read the comment docs.
Mypy has been complaining about Sequence methods
ljust()
,rjust()
, andcenter()
which are part ofstr
, but overwritten. It looks like these use theSupportsIndex
type rather thanint
, which just means they have an__index__()
method. Most of the time this meansint
, but a custom type could implement the method and then you could use it instead of anint
.This PR fixes those type annotations and adds parity support to the
Sequence
formatting methods (rjust()
,ljust()
,center()
,truncate()
), so they can also take a custom class that implements the__index__()
method for width.