D7275: encoding: add comment-based type hints for pytype

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 7 11:08:37 EST 2019


durin42 added inline comments.

INLINE COMMENTS

> indygreg wrote in encoding.py:24
> Am I missing something here? Won't `globals()` always return a dict with elements? And isn't `typing` only available on Python 3?

This is a moderately bonkers way to write `if False` that pyflakes won't complain about and pytype won't be able to elide, so we can have pytype-only imports in the file to make the type annotation comments work.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7275/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7275

To: durin42, #hg-reviewers
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list