Message10898
The solution that zyasoft (Jim Baker) suggested seems to work fine.
I tested this by changing it to a LinkedHashSet in Generic (May not be the ideal place but for the test I did this).
Then using the interpreter:
>>> Exception.__subclasses__()
[<type 'exceptions.StandardError'>, <type 'exceptions.StopIteration'>, <type 'exceptions.Warning'>, <class 'warnings._OptionError'>, <class 'sre_constants.error'>]
>>> class TestException(Exception):
... test = 1
...
>>>
>>> Exception.__subclasses__()
[<type 'exceptions.StandardError'>, <type 'exceptions.StopIteration'>, <type 'exceptions.Warning'>, <class 'warnings._OptionError'>, <class 'sre_constants.error'>, <class '__main__.TestException'>]
>>> Exception.__subclasses__()
[<type 'exceptions.StandardError'>, <type 'exceptions.StopIteration'>, <type 'exceptions.Warning'>, <class 'warnings._OptionError'>, <class 'sre_constants.error'>, <class '__main__.TestException'>]
Indicating the order is now retained as previously the items would all be random. |
|
Date |
User |
Action |
Args |
2016-08-17 17:09:09 | Myles | set | messageid: <1471453749.11.0.432698641468.issue2514@psf.upfronthosting.co.za> |
2016-08-17 17:09:09 | Myles | set | recipients:
+ Myles, zyasoft |
2016-08-17 17:09:09 | Myles | link | issue2514 messages |
2016-08-17 17:09:08 | Myles | create | |
|