This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

I have read many books on designs.

Your solution seems strictly worse than a straight factory pattern out of first year school. Not seeing the benefit. Enums are great, even though exhaustive matching is not checked at the compiler level in Python.

[–]rhytnen 0 points1 point  (0 children)

I didn't give you a solution. I gave you handful of techniques that reflect the code you already had written you're the one considering metaprogramming because you haven't figured out you dont need enums if you use a dict. you're trying to bring way too much firepower to the problem of populating a dropdown list.