jenkins-bot submitted this change.
[IMPR] derive ParamInfo from collections.abc.Sized
- ParamInfo is a sized container. Derive this class from
collections.abc.Sized too and make __len__ definition
mandatory
Change-Id: I1e38db40818ba8c03f1b125e08e36cce4d1dd4cf
---
M pywikibot/data/api.py
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 8a80457..4414493 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -17,9 +17,9 @@
import traceback
try:
- from collections.abc import Container, MutableMapping
+ from collections.abc import Container, MutableMapping, Sized
except ImportError: # Python 2.7
- from collections import Container, MutableMapping
+ from collections import Container, MutableMapping, Sized
from email.mime.nonmultipart import MIMENonMultipart
from warnings import warn
@@ -182,7 +182,7 @@
super(APIMWException, self).__init__(code, info, **kwargs)
-class ParamInfo(Container):
+class ParamInfo(Sized, Container):
"""
API parameter information data object.
To view, visit change 605850. To unsubscribe, or for help writing mail filters, visit settings.