Skip to content
Snippets Groups Projects
Commit 75811491 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Use __future__.annotations

parent 209c83c4
No related branches found
No related tags found
1 merge request!278Port to Python 3
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
A module for logic controlling the manner in which ZKAPs are spent. A module for logic controlling the manner in which ZKAPs are spent.
""" """
from __future__ import annotations
from typing import Callable, List, Tuple from typing import Callable, List, Tuple
import attr import attr
...@@ -126,7 +128,7 @@ class PassGroup(object): ...@@ -126,7 +128,7 @@ class PassGroup(object):
def unblinded_tokens(self) -> List[UnblindedToken]: def unblinded_tokens(self) -> List[UnblindedToken]:
return list(unblinded_token for (unblinded_token, pass_) in self._tokens) return list(unblinded_token for (unblinded_token, pass_) in self._tokens)
def split(self, select_indices: List[int]) -> ("PassGroup", "PassGroup"): def split(self, select_indices: List[int]) -> (PassGroup, PassGroup):
selected = [] selected = []
unselected = [] unselected = []
for idx, t in enumerate(self._tokens): for idx, t in enumerate(self._tokens):
...@@ -139,7 +141,7 @@ class PassGroup(object): ...@@ -139,7 +141,7 @@ class PassGroup(object):
attr.evolve(self, tokens=unselected), attr.evolve(self, tokens=unselected),
) )
def expand(self, by_amount: int) -> "PassGroup": def expand(self, by_amount: int) -> PassGroup:
return attr.evolve( return attr.evolve(
self, self,
tokens=self._tokens + self._factory.get(self._message, by_amount)._tokens, tokens=self._tokens + self._factory.get(self._message, by_amount)._tokens,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment