mediawiki-utilities / python-mwapi

Simple Python Wrapper around MediaWiki API
http://pythonhosted.org/mwapi
MIT License
30 stars 11 forks source link

Support boolean parameters #37

Closed lucaswerkmeister closed 5 years ago

lucaswerkmeister commented 5 years ago

This module currently doesn’t provide any special support for boolean parameters, which means that if I specify foo=False as a keyword argument, it will be sent just like that to the MediaWiki API, which will then proceed to interpret it as “true” because “false” has to be indicated by the complete absence of the parameter.

It would be great if, similar to the existing support for pipe-separated lists (#8), it learned to turn foo=True into foo= and foo=False into no parameter at all. (It would be the responsibility of the user to only provide boolean values for parameters that the MediaWiki API also interprets as booleans.)