Thanks for the contributions! However, multiple problems exist.
Saving tokens in self is a bad idea - because you can never know if they are valid or not at that point of time. Hence just returning them - caching and validation will have to be done by the application
python-mwapi is a library, and hence should never use 'print'. A better way would be to perhaps throw an exception, or set them to None.
Save tokens in self.tokens and throw warning/s if token for any requested action is not supported for user.