Message288774
@ethan, didn't know about aenum, thanks for showing it to me. However it doesn't seem to support the behavior I'm after (or I'm doing something wrong)
import aenum
try:
class Foo(aenum.Flag):
a = aenum.auto()
b = a | aenum.auto()
except Exception as err:
print(err)
try:
class Bar(aenum.Flag):
a = aenum.auto()
b = aenum.auto() | a
except Exception as err:
print(err)
results in
unsupported operand type(s) for |: 'int' and 'auto'
exceptions must derive from BaseException
where the latter might be a bug in the implementation.
I do realize that I'm stuck with this for the moment. My motivation with opening this thread was that I was wondering if such a feature would be worthwhile for the community. In case there is interest in this feature I would try to run the unit test and follow all the steps to try to push it through. However I save myself the work in case the community decides that the implementation is not worth it. Which would also be fine with me, as I monkey patched it for my code - so no problem on my end. |
|
Date |
User |
Action |
Args |
2017-03-01 19:05:57 | magu | set | recipients:
+ magu, ethan.furman, serhiy.storchaka, mdk |
2017-03-01 19:05:57 | magu | set | messageid: <1488395157.6.0.164229040904.issue29594@psf.upfronthosting.co.za> |
2017-03-01 19:05:57 | magu | link | issue29594 messages |
2017-03-01 19:05:57 | magu | create | |
|