From 07886c1991811ad7a907ac2dfbcd5d7a1e1e9490 Mon Sep 17 00:00:00 2001 From: Phoenix Zerin Date: Thu, 14 Jun 2018 09:04:17 +1200 Subject: [PATCH] Fixed incorrect type hints. --- iota/crypto/addresses.py | 4 ++-- iota/crypto/signing.py | 1 + iota/transaction/validator.py | 2 +- iota/types.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iota/crypto/addresses.py b/iota/crypto/addresses.py index 072540b..88eb001 100644 --- a/iota/crypto/addresses.py +++ b/iota/crypto/addresses.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function, \ unicode_literals -from typing import Generator, Iterable, List, MutableSequence +from typing import Generator, Iterable, List from iota import Address, TRITS_PER_TRYTE, TrytesCompatible from iota.crypto.kerl import Kerl @@ -132,7 +132,7 @@ def get_addresses(self, start, count=1, step=1): return addresses def create_iterator(self, start=0, step=1): - # type: (int, int) -> Generator[Address] + # type: (int, int) -> Generator[Address, None, None] """ Creates an iterator that can be used to progressively generate new addresses. diff --git a/iota/crypto/signing.py b/iota/crypto/signing.py index da01ad4..c598775 100644 --- a/iota/crypto/signing.py +++ b/iota/crypto/signing.py @@ -15,6 +15,7 @@ __all__ = [ 'KeyGenerator', + 'KeyIterator', 'SignatureFragmentGenerator', 'validate_signature_fragments', ] diff --git a/iota/transaction/validator.py b/iota/transaction/validator.py index 0666cab..d1088eb 100644 --- a/iota/transaction/validator.py +++ b/iota/transaction/validator.py @@ -68,7 +68,7 @@ def is_valid(self): return not self._errors def _create_validator(self): - # type: () -> Generator[Text] + # type: () -> Generator[Text, None, None] """ Creates a generator that does all the work. """ diff --git a/iota/types.py b/iota/types.py index 70372f9..609d1d8 100644 --- a/iota/types.py +++ b/iota/types.py @@ -321,7 +321,7 @@ def __len__(self): return len(self._trytes) def __iter__(self): - # type: () -> Generator[binary_type] + # type: () -> Generator[binary_type, None, None] # :see: http://stackoverflow.com/a/14267935/ return (binary_type(self._trytes[i:i + 1]) for i in range(len(self)))