From d32c4942b07c95174f3eec11daf3ca9d891cfd77 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 5 Nov 2022 07:47:18 -0700 Subject: [PATCH] unicodedata: accepts ReadOnlyBuffer --- stdlib/unicodedata.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/unicodedata.pyi b/stdlib/unicodedata.pyi index 7337ab8789b2..5a9aa0a3395f 100644 --- a/stdlib/unicodedata.pyi +++ b/stdlib/unicodedata.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import ReadOnlyBuffer from typing import Any, TypeVar from typing_extensions import final @@ -21,7 +22,7 @@ def east_asian_width(__chr: str) -> str: ... if sys.version_info >= (3, 8): def is_normalized(__form: str, __unistr: str) -> bool: ... -def lookup(__name: str | bytes) -> str: ... +def lookup(__name: str | ReadOnlyBuffer) -> str: ... def mirrored(__chr: str) -> int: ... def name(__chr: str, __default: _T = ...) -> str | _T: ... def normalize(__form: str, __unistr: str) -> str: ... @@ -41,7 +42,7 @@ class UCD: if sys.version_info >= (3, 8): def is_normalized(self, __form: str, __unistr: str) -> bool: ... - def lookup(self, __name: str | bytes) -> str: ... + def lookup(self, __name: str | ReadOnlyBuffer) -> str: ... def mirrored(self, __chr: str) -> int: ... def name(self, __chr: str, __default: _T = ...) -> str | _T: ... def normalize(self, __form: str, __unistr: str) -> str: ...