DEV Community

Discussion on: Factory Pattern & Abstraction in Python

Collapse
 
ananto30 profile image
Azizul Haque Ananto

Neat! Very clean-code! This seems another approach to the pattern. You tried to separate the class creation based on the file extensions. But you had to use if-else. That's what I tried to show, that using python dispatcher, we can map functions or classes to certain enums, strings, int or whatever your approach will be. We can implement in many other ways. That's the beauty of programming and Python 😃
Thanks for sharing.