File: //lib/python3/dist-packages/numpy/__pycache__/_globals.cpython-310.pyc
o
6��a� � @ sf d Z g d�Zde� v red��dZG dd� de�Zde_G dd � d e�Z de _G d
d� d�Z
e
� ZdS )
aI
Module defining global singleton classes.
This module raises a RuntimeError if an attempt to reload it is made. In that
way the identities of the classes defined here are fixed and will remain so
even if numpy itself is reloaded. In particular, a function like the following
will still work correctly after numpy is reloaded::
def foo(arg=np._NoValue):
if arg is np._NoValue:
...
That was not the case when the singleton classes were defined in the numpy
``__init__.py`` file. See gh-7844 for a discussion of the reload problem that
motivated this module.
)�ModuleDeprecationWarning�VisibleDeprecationWarning�_NoValue�
_is_loadedz'Reloading numpy._globals is not allowedTc @ � e Zd ZdZdS )r a6 Module deprecation warning.
The nose tester turns ordinary Deprecation warnings into test failures.
That makes it hard to deprecate whole modules, because they get
imported by default. So this is a special Deprecation warning that the
nose tester will let pass without making tests fail.
N��__name__�
__module__�__qualname__�__doc__� r r �0/usr/lib/python3/dist-packages/numpy/_globals.pyr � r �numpyc @ r )r z�Visible deprecation warning.
By default, python will not show deprecation warnings, so this class
can be used when a very visible warning is helpful, for example because
the usage is most likely a user bug.
Nr r r r r r , r
r c s4 e Zd ZdZdZ� fdd�Zdd� Zdd� Z� ZS ) �_NoValueTypeaW Special keyword value.
The instance of this class may be used as the default value assigned to a
keyword if no other obvious default (e.g., `None`) is suitable,
Common reasons for using this keyword are:
- A new keyword is added to a function, and that function forwards its
inputs to another function or method which can be defined outside of
NumPy. For example, ``np.std(x)`` calls ``x.std``, so when a ``keepdims``
keyword was added that could only be forwarded if the user explicitly
specified ``keepdims``; downstream array libraries may not have added
the same keyword, so adding ``x.std(..., keepdims=keepdims)``
unconditionally could have broken previously working code.
- A keyword is being deprecated, and a deprecation warning must only be
emitted when the keyword is used.
Nc s | j s
t� �| �| _ | j S )N)�_NoValueType__instance�super�__new__)�cls�� __class__r r r M s z_NoValueType.__new__c C s
| j dfS )Nr r ��selfr r r �
__reduce__T s
z_NoValueType.__reduce__c C s dS )Nz
<no value>r r r r r �__repr__W s z_NoValueType.__repr__) r r r r
r r r r �
__classcell__r r r r r 9 s r N)r
�__ALL__�globals�RuntimeErrorr �DeprecationWarningr r �UserWarningr r r r r r r �<module> s
"