
    hP                        d Z ddlmZ ddlmZ e ed       G d d                    Ze ed       G d d	e                    Ze ed       G d
 de                    Ze ed       G d de                    Ze ed       G d de                    Z	e ed       G d de	                    Z
e ed       G d de
                    Zy)z>A module with the precisions of generic `~numpy.number` types.    )final)
set_moduleznumpy.typingc                   $     e Zd ZdZd fdZ xZS )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                 \    h d}| j                   |vrt        d      t        |           y )N>   _8Bit_16Bit_32Bit_64Bit_96Bit_128Bitr   z*cannot inherit from final class "NBitBase")__name__	TypeErrorsuper__init_subclass__)clsallowed_names	__class__s     =D:\jyotish\venv\Lib\site-packages\numpy/_typing/_nbit_base.pyr   zNBitBase.__init_subclass__9   s/    
 <<},HII!#    )returnN)r   
__module____qualname____doc__r   __classcell__)r   s   @r   r   r      s    ,^$ $r   r   znumpy._typingc                       e Zd Zy)r   Nr   r   r    r   r   r   r   A   s     	r   r   c                       e Zd Zy)r   Nr   r   r   r   r   r   G        	r   r   c                       e Zd Zy)r   Nr   r   r   r   r   r   L   r    r   r   c                       e Zd Zy)r
   Nr   r   r   r   r
   r
   Q   r    r   r
   c                       e Zd Zy)r	   Nr   r   r   r   r	   r	   V   r    r   r	   c                       e Zd Zy)r   Nr   r   r   r   r   r   [   r    r   r   N)r   typingr   numpy._utilsr   r   r   r   r   r
   r	   r   r   r   r   <module>r'      s%   D  # N6$ 6$  6$p O	h 	  	 O	W 	  	 O	V 	  	 O	V 	  	 O	V 	  	 O	F 	  	r   