jenkins-bot submitted this change.
[IMPR] derive abstract WbRepresentation from abstract base class abc.ABC
Change-Id: I78144e78b4059fe4adc8d873bbf255d138f72a2b
---
M pywikibot/_wbtypes.py
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index e074829..46d57a7 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -5,22 +5,26 @@
#
# Distributed under the terms of the MIT license.
#
+import abc
import json
-class WbRepresentation:
+class WbRepresentation(abc.ABC):
"""Abstract class for Wikibase representations."""
+ @abc.abstractmethod
def __init__(self):
"""Constructor."""
raise NotImplementedError
+ @abc.abstractmethod
def toWikibase(self):
"""Convert representation to JSON for the Wikibase API."""
raise NotImplementedError
@classmethod
+ @abc.abstractmethod
def fromWikibase(cls, json):
"""Create a representation object based on JSON from Wikibase API."""
raise NotImplementedError
To view, visit change 616050. To unsubscribe, or for help writing mail filters, visit settings.