jquast / blessed

Blessed is an easy, practical library for making python terminal apps

Home Page:http://pypi.python.org/pypi/blessed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type hints?

dlax opened this issue · comments

It'd be nice to add type hints PEP 484 in blessed code base and then distribute them (following PEP 561).

Is there any interest in this? (or any objection)

Since the library still supports Python 2, we'll need to write type annotations as stub files (.pyi).

I'd be happy to start working on this.

No objection, and thank you for your consideration for retaining backwards compatibility.

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.

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.