DEV Community

Mike Lezhnin
Mike Lezhnin

Posted on

3 2

Random python fact of the day

If you have an abstract base class with a static method, then the order of decorators should be like that:

@staticmethod
@abstractmethod
def my_fancy_method():
    pass

If you switch them around you would get AttributeError: attribute '__isabstractmethod__' of 'staticmethod' objects is not writable. Now you know.

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →