
On Jun 21, 2020, at 10:18 PM, Craig Rodrigues <rodrigc@crodrigues.org> wrote:
On Sat, Jun 20, 2020 at 4:02 PM Tom Most <twm@freecog.net <mailto:twm@freecog.net>> wrote:
Let's definitely move to type annotations, since they are much more likely to be correct due to validation by MyPy.
To start, we'll need to revise the Twisted coding standard [1] to permit type annotations instead of @type lines in the docstring. I think that we should suggest, but not require, annotation syntax to start. I filed a ticket [2] for this.
Revising the Twisted coding standard to permit (and even encourage) type annotations is a great idea. Using epydoc's @type tags in docstring was OK, but epydoc is not a tool that is universally used in the Python world. At the time, using epydoc tags was the best that could be done. Type annotations are a first-level language feature, that is part of the core Python toolchain. There seems to be growing support for type annotations from various tools, IDE's, Python libraries, and the core Python toolchain itself.
I'm 100% in favor of moving to type annotations exclusively and getting rid of @type from everywhere. In fact this has been the plan since 2017: https://github.com/twisted/pydoctor/issues/136 <https://github.com/twisted/pydoctor/issues/136> Getting that issue resolved is the only blocker at this point :) -g