DEV Community

Discussion on: Refactoring an Overgrown Notifications Class in Django

Collapse
 
spookylukey profile image
Luke Plant • Edited

Is there a reason for SendNotificationMixin to be a class or a mixin? It's methods do not use 'self' at all (except self.send_email, and that should just be a function call). Classes which do not have any state, and do not use self, are just namespaces for functions, except they are harder to use (e.g. you have to instantiate them or inherit from them etc.). Python normally uses modules for namespaces, not classes. youtube.com/watch?v=o9pEzgHorH0