hyb
2026-01-09 4cb426cb3ae31e772a09d4ade5b2f0242aaeefa0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Ë
KñúhP ãó˜—dZddlmZddlmZeed«Gd„d«««Zeed«Gd„d    e«««Zeed«Gd
„d e«««Zeed«Gd „d e«««Zeed«Gd„de«««Z    eed«Gd„de    «««Z
eed«Gd„de
«««Z y)z>A module with the precisions of generic `~numpy.number` types.é)Úfinal)Ú
set_modulez numpy.typingcó$‡—eZdZdZdˆfd„ ZˆxZS)ÚNBitBasea(
    A type representing `numpy.number` precision during static type checking.
 
    Used exclusively for the purpose of static type checking, `NBitBase`
    represents the base of a hierarchical set of subclasses.
    Each subsequent subclass is herein used for representing a lower level
    of precision, *e.g.* ``64Bit > 32Bit > 16Bit``.
 
    .. versionadded:: 1.20
 
    .. deprecated:: 2.3
        Use ``@typing.overload`` or a ``TypeVar`` with a scalar-type as upper
        bound, instead.
 
    Examples
    --------
    Below is a typical usage example: `NBitBase` is herein used for annotating
    a function that takes a float and integer of arbitrary precision
    as arguments and returns a new float of whichever precision is largest
    (*e.g.* ``np.float16 + np.int64 -> np.float64``).
 
    .. code-block:: python
 
        >>> from typing import TypeVar, TYPE_CHECKING
        >>> import numpy as np
        >>> import numpy.typing as npt
 
        >>> S = TypeVar("S", bound=npt.NBitBase)
        >>> T = TypeVar("T", bound=npt.NBitBase)
 
        >>> def add(a: np.floating[S], b: np.integer[T]) -> np.floating[S | T]:
        ...     return a + b
 
        >>> a = np.float16()
        >>> b = np.int64()
        >>> out = add(a, b)
 
        >>> if TYPE_CHECKING:
        ...     reveal_locals()
        ...     # note: Revealed local types are:
        ...     # note:     a: numpy.floating[numpy.typing._16Bit*]
        ...     # note:     b: numpy.signedinteger[numpy.typing._64Bit*]
        ...     # note:     out: numpy.floating[numpy.typing._64Bit*]
 
    có\•—hd£}|j|vr td«‚t‰| «y)N>Ú_8BitÚ_16BitÚ_32BitÚ_64BitÚ_96BitÚ_128Bitrz*cannot inherit from final class "NBitBase")Ú__name__Ú    TypeErrorÚsuperÚ__init_subclass__)ÚclsÚ allowed_namesÚ    __class__s  €úKH:\Change_password\venv_build\Lib\site-packages\numpy/_typing/_nbit_base.pyrzNBitBase.__init_subclass__9s/ø€ò
ˆ ð <‰<˜}Ñ ,ÜÐHÓIÐ IÜ ‰Ñ!Õ#ó)ÚreturnN)rÚ
__module__Ú __qualname__Ú__doc__rÚ __classcell__)rs@rrrsø„ñ,÷^$ñ$rrz numpy._typingcó —eZdZy)r N©rrr©rrr r As„ð    rr có —eZdZy)r Nrrrrr r Gó„ð    rr có —eZdZy)r Nrrrrr r Lr rr có —eZdZy)r
Nrrrrr
r
Qr rr
có —eZdZy)r    Nrrrrr    r    Vr rr    có —eZdZy)rNrrrrrr[r rrN) rÚtypingrÚ numpy._utilsrrr r r r
r    rrrrú<module>r's%ðÙDÝå#ðÙ ˆNÓ÷6$ð6$óóð6$ðpÙ ˆOÓô    ˆhó    óóð    ðÙ ˆOÓô    ˆWó    óóð    ðÙ ˆOÓô    ˆVó    óóð    ðÙ ˆOÓô    ˆVó    óóð    ðÙ ˆOÓô    ˆVó    óóð    ðÙ ˆOÓô    ˆFó    óóñ    r