mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Update the xxhash and hashlib stubs (#6031)
* `name`, `block_size`, `digest_size` and `digestsize` attributes of hash objects were made read-only. * It is now a type-checking error to subclass `xxhash` classes, such as `xxhash.xxh32`. Previously it was an error only at runtime. * `xxhash` functions now accept strings as input and any object with `__index__()` method for `seed` (instead of requiring an integer). They also fail the type checking if no arguments are given.
This commit is contained in:
@@ -3,10 +3,14 @@ from typing import Tuple, Union
|
||||
_DataType = Union[str, unicode, bytearray, buffer, memoryview]
|
||||
|
||||
class _hash(object): # This is not actually in the module namespace.
|
||||
name: str
|
||||
block_size: int
|
||||
digest_size: int
|
||||
digestsize: int
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def block_size(self) -> int: ...
|
||||
@property
|
||||
def digest_size(self) -> int: ...
|
||||
@property
|
||||
def digestsize(self) -> int: ...
|
||||
def __init__(self, arg: _DataType = ...) -> None: ...
|
||||
def update(self, arg: _DataType) -> None: ...
|
||||
def digest(self) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user