type hints?
dlax opened this issue · comments
No objection, and thank you for your consideration for retaining backwards compatibility.
- I hope you recognize that there may be little benefit to downstream developers, which mainly call into the class's magic
__getattr__
method, https://github.com/jquast/blessed/blob/master/blessed/terminal.py#L343-L375 I don't expect type hinting to work? - And may be difficult to annotate, such as the metaclassing of
__new__
and__call__
methods inblessed.formatters
.
So I'm not particularly eager for it, but if the type annotations are well accurate and it passes tests for these older platforms, I would merge it.
- I hope you recognize that there may be little benefit to downstream developers, which mainly call into the class's magic
__getattr__
method, https://github.com/jquast/blessed/blob/master/blessed/terminal.py#L343-L375 I don't expect type hinting to work?- And may be difficult to annotate, such as the metaclassing of
__new__
and__call__
methods inblessed.formatters
.
The __call__
part is indeed a bit tricky. I made it work by ensuring that all formatters declare the same interface Callable[[Union[int, str]], ...]
despite some of them only accept either int
or str
.
Out of curiosity (it doesn't matter here), is support for python 2.6 still desirable?
I think we decided python 2.6 is no longer supported/tested, thanks
Released to pypi, version 1.18.0, thank you again, @dlax.