Mercurial > public > mercurial-scm > hg
comparison mercurial/mail.py @ 43773:7b14d649af1b
typing: consolidate "if not globals():" trick
Removes redundant inline comments. I think pycompat is good place to host
this kind of constants.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 19 Nov 2019 23:49:05 +0900 |
parents | ddb5d097d561 |
children | 8f26dd09aa78 |
comparison
equal
deleted
inserted
replaced
43772:ee3872c14ab3 | 43773:7b14d649af1b |
---|---|
34 from .utils import ( | 34 from .utils import ( |
35 procutil, | 35 procutil, |
36 stringutil, | 36 stringutil, |
37 ) | 37 ) |
38 | 38 |
39 if not globals(): # hide this from non-pytype users | 39 if pycompat.TYPE_CHECKING: |
40 from typing import Any, List, Tuple, Union | 40 from typing import Any, List, Tuple, Union |
41 | 41 |
42 # keep pyflakes happy | 42 # keep pyflakes happy |
43 assert all((Any, List, Tuple, Union)) | 43 assert all((Any, List, Tuple, Union)) |
44 | 44 |