DEV Community

Discussion on: When to use continue, pass and break in python.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

Even more common use case for the pass statement is empty classes that don't override anything from their parents.

It's not unusual to see code like this somewhere in a package to define a local exception hierarchy:

class FooException(Exception):
    pass


class FailedToBar(FooException):
    pass


class FailedToBaz(FooException):
    pass
Collapse
 
sharmapacific profile image
Prashant Sharma

Yes, as no code needs to be executed.