In the context of fixing current issues within basemap, one easy step is to use static analysis tools, since they can catch the most evident problems.
I open this issue as a reminder to enable flake8 in the development workflow; flake8 will catch the most evident code mistakes, and it will also give advice on changes that will make the code more pep8-compliant. Enabling pylint at this moment is not recommended, because it will complain too much.