diff options
author | Nathaniel Manista <nathaniel@google.com> | 2015-03-16 23:35:15 +0000 |
---|---|---|
committer | Nathaniel Manista <nathaniel@google.com> | 2015-03-16 23:35:15 +0000 |
commit | 8d81365a3c03184683782cdd2dd8a9c934c790c7 (patch) | |
tree | 07f4f91e491aa796f92af9ead5afe7fb9c6f39ba /src/python | |
parent | ae3e5b53f04883c9386e7d80789d92c13acc1e2f (diff) |
Iterate over an enum since we can
Since enums are themselves iterable there's no need to maintain a list
of the elements of the enum dating from back before the enum when its
values were just independent constants that hung out together.
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/src/grpc/framework/base/packets/_ends.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/python/src/grpc/framework/base/packets/_ends.py b/src/python/src/grpc/framework/base/packets/_ends.py index ca35cdd9b4..614d1f666e 100644 --- a/src/python/src/grpc/framework/base/packets/_ends.py +++ b/src/python/src/grpc/framework/base/packets/_ends.py @@ -50,16 +50,6 @@ from grpc.framework.foundation import callable_util _IDLE_ACTION_EXCEPTION_LOG_MESSAGE = 'Exception calling idle action!' -_OPERATION_OUTCOMES = ( - base_interfaces.Outcome.COMPLETED, - base_interfaces.Outcome.CANCELLED, - base_interfaces.Outcome.EXPIRED, - base_interfaces.Outcome.RECEPTION_FAILURE, - base_interfaces.Outcome.TRANSMISSION_FAILURE, - base_interfaces.Outcome.SERVICER_FAILURE, - base_interfaces.Outcome.SERVICED_FAILURE, - ) - class _EasyOperation(base_interfaces.Operation): """A trivial implementation of base_interfaces.Operation.""" @@ -98,7 +88,7 @@ class _Endlette(object): # indicates an in-progress fire-and-forget operation for which the customer # has chosen to ignore results. self._operations = {} - self._stats = {outcome: 0 for outcome in _OPERATION_OUTCOMES} + self._stats = {outcome: 0 for outcome in base_interfaces.Outcome} self._idle_actions = [] def terminal_action(self, operation_id): |