Message400290
David, I added a PR for the Enum handling/creation in the ics library. Syncing values with external libraries is definitely *not* what `auto` is intended for.
As for why enum members evaluate as True: most objects in Python evaluate to True, unless they have a reason not to (such as an empty container or the number 0). One of the main ideas behind the creation of Enum is that the exact values didn't usually matter, but when they did they would be specified. `auto()` was added later to make the "doesn't usually matter" case easier.
---
Vedran, or `cEnum`? ;-)
One concern is should cEnum be Python's `int`, or a c_type int? That should be in a new issue, though.
Okay, it's Issue45004. |
|
Date |
User |
Action |
Args |
2021-08-25 19:25:09 | ethan.furman | set | recipients:
+ ethan.furman, eric.smith, veky, David Rebbe2 |
2021-08-25 19:25:09 | ethan.furman | set | messageid: <1629919509.6.0.0285212128399.issue44993@roundup.psfhosted.org> |
2021-08-25 19:25:09 | ethan.furman | link | issue44993 messages |
2021-08-25 19:25:09 | ethan.furman | create | |
|