AntiCompositeNumber added a comment.
| Stub files |
Inline annotations
|
| --------------------------------------------------------------------- |
------------------------------------------------------------------------------------
|
| Are completely independent of runtime behavior | Do
not affect runtime behavior, but must be valid syntax in that python version
|
| Always uses function and variable annotations | To
support py3.5, type comments have to be used for variables instead of
annotations |
| Increases the number of files in the repo |
Increases the length of function and variable definitions in code
|
| Are disconnected from actual implementation |
Helps make code more self-documenting
|
| Separates `typing` and other type object imports from runtime imports |
Requires extra imports of type objects
|
| Only used in downstream code | Can
be used to type-check pywikibot
|
|
From my perspective, it's a question of if pywikibot intends to use static
type checking or just provide type information for downstream code. If there's
an intention to do type checking on pywikibot's code or a feeling that inline
annotations would improve readability and maintainability, then I'd suggest
waiting for py2 to be dropped and using those. If that's not the case, then
using stub files decreases the overhead for pywikibot devs not interested in
type annotations. It's also easy enough to convert between a stub file and
inline annotations in the future.
Where the type information is stored isn't really something that affects me
as a downstream user of pywikibot. That detail only really affects the active
pywikibot developers. I'm willing to help add type information wherever it may
be.
TASK DETAIL
https://phabricator.wikimedia.org/T250711
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: AntiCompositeNumber
Cc: Xqt, Aklapper, AntiCompositeNumber, pywikibot-bugs-list, Zkhalido, Viztor,
Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis,
mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs