warcio icon indicating copy to clipboard operation
warcio copied to clipboard

Plans for adding type annotations?

Open dnaaun opened this issue 4 years ago • 6 comments

Hi all,

Are type annotations on the roadmap at all? Would you take PRs for it? If so, would you prefer the comment-based, Python2 compatible annotation scheme, or the syntax introduced by PEP 526(which means dropping support for anything older than Py3.6)?

PS: It's always a great feeling when you know there's a (well maintained) Python library out there tailored exactly to your current needs. Thank you!

dnaaun avatar Sep 16 '20 02:09 dnaaun

We still support 2.7 as well as 3.4 and 3.5.

wumpus avatar Sep 16 '20 04:09 wumpus

Got it @wumpus !

My other question is: do you plan on adding (or accepting PRs that add) type annotations the code base? One of the following methods can accomplish this(even in python versions older than 3.6)

  1. Type comments
  2. Stub files
  3. Stub-only packages

dnaaun avatar Sep 16 '20 13:09 dnaaun

Can you produce a short example as a PR? Then we can see if (1) if it can pass our CI in all python versions and (2) how pretty it looks.

wumpus avatar Sep 16 '20 16:09 wumpus

My intent with this question was to see if there's a plan already for type annotations, since I usually end up annotating the libraries I use (if they're small enough), and I wanted to follow any guidelines that were already in place so I can contribute the annotations back.

If I end up using the library, and writing up type annotations as a result, I'll be sure to create a PR and ping you here.

dnaaun avatar Sep 16 '20 16:09 dnaaun

I don't think there is any plan, and I'd love to have one. If we can keep our current range of pythons and have annotations, that would be awesome.

wumpus avatar Sep 16 '20 22:09 wumpus

There is no plan and I don't have time to focus on that, but happy to review a PR. Looking at it briefly, the type comments seems to be the best option, and comparable to the type annotations. For now, it would not be worth it to drop older versions to support annotations.

ikreymer avatar Sep 17 '20 06:09 ikreymer