jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/579864 )
Change subject: [IMPR] logging._inited_routines as a set ......................................................................
[IMPR] logging._inited_routines as a set
- change logging._inited_routines from list to set for better lookup
Change-Id: Ia4d9a5b287767edfb43390f4142b9dbee8a58707 --- M pywikibot/logging.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/logging.py b/pywikibot/logging.py index 1074188..033c628 100644 --- a/pywikibot/logging.py +++ b/pywikibot/logging.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Logging functions.""" # -# (C) Pywikibot team, 2010-2019 +# (C) Pywikibot team, 2010-2020 # # Distributed under the terms of the MIT license. # @@ -22,7 +22,7 @@ unicode = str
_init_routines = [] -_inited_routines = [] +_inited_routines = set()
def add_init_routine(routine): @@ -35,10 +35,10 @@ for init_routine in _init_routines: if init_routine not in _inited_routines: init_routine() - _inited_routines.append(init_routine) + _inited_routines.add(init_routine)
# Clear the list of routines to be inited - _init_routines[:] = [] + _init_routines[:] = [] # the global variable is used with slice operator
# User output/logging functions
pywikibot-commits@lists.wikimedia.org