Generate the next value when not given. name: the name of the member start: the initial start value or None count: the number of existing members last_values: the last value assigned or None
(name, start, count, last_values)
| 1434 | |
| 1435 | @staticmethod |
| 1436 | def _generate_next_value_(name, start, count, last_values): |
| 1437 | """ |
| 1438 | Generate the next value when not given. |
| 1439 | |
| 1440 | name: the name of the member |
| 1441 | start: the initial start value or None |
| 1442 | count: the number of existing members |
| 1443 | last_values: the last value assigned or None |
| 1444 | """ |
| 1445 | if not count: |
| 1446 | return start if start is not None else 1 |
| 1447 | last_value = max(last_values) |
| 1448 | try: |
| 1449 | high_bit = _high_bit(last_value) |
| 1450 | except Exception: |
| 1451 | raise TypeError('invalid flag value %r' % last_value) from None |
| 1452 | return 2 ** (high_bit+1) |
| 1453 | |
| 1454 | @classmethod |
| 1455 | def _iter_member_by_value_(cls, value): |
nothing calls this directly
no test coverage detected