Message236236
Craig Holmquist wrote:
---------------------
> The consumer of that iteration processes each object with a switch-case-like
> comparison of the category, checking it sequentially against each instance
> of the Enum.
So for every object you compare against every Enum member? Is there a reason you don't just use the lookup capability?
class Category(Enum):
tiny = 1
medium = 2
large = 3
cat = Category(obj.category) # assumes obj.category is 1, 2, or 3 |
|
Date |
User |
Action |
Args |
2015-02-19 22:12:02 | ethan.furman | set | recipients:
+ ethan.furman, craigh |
2015-02-19 22:12:02 | ethan.furman | set | messageid: <1424383922.1.0.193945991188.issue23486@psf.upfronthosting.co.za> |
2015-02-19 22:12:02 | ethan.furman | link | issue23486 messages |
2015-02-19 22:12:02 | ethan.furman | create | |
|