jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/642905 )
Change subject: [IMPR] Add repr() method to BaseDataDict and ClaimCollection ......................................................................
[IMPR] Add repr() method to BaseDataDict and ClaimCollection
Change-Id: I26a3048a0fa4696a435fe597dc075c8d56962d4b --- M pywikibot/page/__init__.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index 46ecef9..94e9c55 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -3397,6 +3397,9 @@ key = self.normalizeKey(key) return key in self._data
+ def __repr__(self): + return '{}({})'.format(type(self), self._data) + @staticmethod def normalizeKey(key) -> str: """Helper function to return language codes of a site object.""" @@ -3531,6 +3534,9 @@ def __contains__(self, key): return key in self._data
+ def __repr__(self): + return '{}({})'.format(type(self), self._data) + @classmethod def normalizeData(cls, data): # no normalization here, should there be?
pywikibot-commits@lists.wikimedia.org