This was a valid pylint warning: if you are not using the __init__ superclass, you can skip implementing the changes to the parent class. And indeed, you have - because BaseException.message deprecated from Python 2.6.
There would be an implementation that avoids the W0231 warning, and also avoids the python erase warning about the message attribute.
class InvalidTeamError(Exception): def __init__(self, message='This user belongs to a different team'): super(InvalidTeamError, self).__init__(message)
This is the best way to do this, because the implementation for BaseException.__str__ only considers the "args" tuple, it doesn’t look at the message at all. With your old implementation, print InvalidTeamError() will print only an empty string, which is probably not what you like!
wim
source share