type annotations

Issue #141 new
Matthias Troffaes created an issue

With the latest version of pybtex no longer working on Python 2 (see issue #138), and if Python 2 is indeed formally dropped, would it be ok to start working on adding type annotations in function signatures throughout the API? I’ve found these immensely useful both for debugging code, and for understanding what various functions do. It would improve the usability of the library when using editors that support code completion and context information based on type annotations (such as pycharm), and it also helps with catching bugs (e.g. by running code through a type checker such as mypy).

Python 2 also supports type annotations but they are comment style only, and not very pretty. The new syntax for type annotations in Python 3 is much nicer to work with. See https://docs.python.org/3/library/typing.html

Comments (1)

  1. Log in to comment