Marc Guetg added the comment:

@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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29594>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to