Update pbkdf2_hmac argument names for 3.4+ (#1241)

* Update pbkdf2_hmac for Python 3.5

- Use `iterations` instead of `rounds` if running on 3.5
- Change `dklen` to `Optional`

* Use `iterations` instead of `rounds` in 3.4+
This commit is contained in:
Nathan Henrie
2017-05-04 22:09:07 -06:00
committed by Jelle Zijlstra
parent a2561cc4b2
commit b8a3f9359f

View File

@@ -1,7 +1,8 @@
# Stubs for hashlib
import sys
from abc import abstractmethod, ABCMeta
from typing import AbstractSet, Union
from typing import AbstractSet, Optional, Union
_DataType = Union[bytes, bytearray, memoryview]
@@ -37,4 +38,5 @@ algorithms_guaranteed = ... # type: AbstractSet[str]
algorithms_available = ... # type: AbstractSet[str]
# New in version 3.4
def pbkdf2_hmac(name: str, password: _DataType, salt: _DataType, rounds: int, dklen: int = ...) -> bytes: ...
if sys.version_info >= (3, 4):
def pbkdf2_hmac(hash_name: str, password: _DataType, salt: _DataType, iterations: int, dklen: Optional[int] = ...) -> bytes: ...