mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +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:
@@ -1,17 +1,16 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer
|
||||
from _typeshed import ReadableBuffer, Self
|
||||
from typing import AbstractSet
|
||||
|
||||
class _Hash(object):
|
||||
digest_size: int
|
||||
block_size: int
|
||||
|
||||
# [Python documentation note] Changed in version 3.4: The name attribute has
|
||||
# been present in CPython since its inception, but until Python 3.4 was not
|
||||
# formally specified, so may not exist on some platforms
|
||||
name: str
|
||||
@property
|
||||
def digest_size(self) -> int: ...
|
||||
@property
|
||||
def block_size(self) -> int: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
def __init__(self, data: ReadableBuffer = ...) -> None: ...
|
||||
def copy(self) -> _Hash: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
def digest(self) -> bytes: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, __data: ReadableBuffer) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user