| whym created this task. whym added a project: Pywikibot-interwiki.py. Herald added subscribers: pywikibot-bugs-list, Zppix, Aklapper. |
I believe global variables are generally a bad practice. interwiki.py encapsulates them into class Global, but keeps using the single container global variable globalvar (which is an instance of Global). Not using global variables helps testing.
We could get rid of it by passing Global instances around as arguments. The affected classes would be Subject and InterwikiBot only.
A potential problem is breaking backward compatibility - if other scripts use class InterwikiBot, they would have accessed interwikibot.globalvar directly. [1] Could we accept that such scripts might break and they have to be updated?
If we are to do this, I also suggest renaming Global into InterwikiBotConfig or simply Config.
[1] See for example: https://gist.github.com/whym/4af2d44d586942ab03f51800b0398425/05decb25d78690fb6271458a96b1843677c9bb5b
Cc: Aklapper, Zppix, pywikibot-bugs-list, whym
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
