Debian Codegraph @

jedi/third_party/typeshed/stdlib/unicodedata.pyi

raw symbols SCIP
1 import sys
2 from _typeshed import ReadOnlyBuffer
3 from typing import Any, Final, Literal, TypeVar, final, overload
4 from typing_extensions import TypeAlias
5
6 ucd_3_2_0: UCD
7 unidata_version: Final[str]
8
9 if sys.version_info < (3, 10):
10 ucnhash_CAPI: Any
11
12 _T = TypeVar("_T")
13
14 _NormalizationForm: TypeAlias = Literal["NFC", "NFD", "NFKC", "NFKD"]
15
16 def bidirectional(chr: str, /) -> str: ...
17 def category(chr: str, /) -> str: ...
18 def combining(chr: str, /) -> int: ...
19 @overload
20 def decimal(chr: str, /) -> int: ...
21 @overload
22 def decimal(chr: str, default: _T, /) -> int | _T: ...
23 def decomposition(chr: str, /) -> str: ...
24 @overload
25 def digit(chr: str, /) -> int: ...
26 @overload
27 def digit(chr: str, default: _T, /) -> int | _T: ...
28
29 _EastAsianWidth: TypeAlias = Literal["F", "H", "W", "Na", "A", "N"]
30
31 def east_asian_width(chr: str, /) -> _EastAsianWidth: ...
32 def is_normalized(form: _NormalizationForm, unistr: str, /) -> bool: ...
33 def lookup(name: str | ReadOnlyBuffer, /) -> str: ...
34 def mirrored(chr: str, /) -> int: ...
35 @overload
36 def name(chr: str, /) -> str: ...
37 @overload
38 def name(chr: str, default: _T, /) -> str | _T: ...
39 def normalize(form: _NormalizationForm, unistr: str, /) -> str: ...
40 @overload
41 def numeric(chr: str, /) -> float: ...
42 @overload
43 def numeric(chr: str, default: _T, /) -> float | _T: ...
44 @final
45 class UCD:
46 # The methods below are constructed from the same array in C
47 # (unicodedata_functions) and hence identical to the functions above.
48 unidata_version: str
49 def bidirectional(self, chr: str, /) -> str: ...
50 def category(self, chr: str, /) -> str: ...
51 def combining(self, chr: str, /) -> int: ...
52 @overload
53 def decimal(self, chr: str, /) -> int: ...
54 @overload
55 def decimal(self, chr: str, default: _T, /) -> int | _T: ...
56 def decomposition(self, chr: str, /) -> str: ...
57 @overload
58 def digit(self, chr: str, /) -> int: ...
59 @overload
60 def digit(self, chr: str, default: _T, /) -> int | _T: ...
61 def east_asian_width(self, chr: str, /) -> _EastAsianWidth: ...
62 def is_normalized(self, form: _NormalizationForm, unistr: str, /) -> bool: ...
63 def lookup(self, name: str | ReadOnlyBuffer, /) -> str: ...
64 def mirrored(self, chr: str, /) -> int: ...
65 @overload
66 def name(self, chr: str, /) -> str: ...
67 @overload
68 def name(self, chr: str, default: _T, /) -> str | _T: ...
69 def normalize(self, form: _NormalizationForm, unistr: str, /) -> str: ...
70 @overload
71 def numeric(self, chr: str, /) -> float: ...
72 @overload
73 def numeric(self, chr: str, default: _T, /) -> float | _T: ...