3
¨K´^K	  ã               @   s~   d Z ddlmZmZmZ dddgZdeƒ kr4edƒ‚dZG d	d„ de	ƒZ
d
e
_G dd„ deƒZd
e_G dd„ deƒZeƒ ZdS )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.

é    )ÚdivisionÚabsolute_importÚprint_functionÚModuleDeprecationWarningÚVisibleDeprecationWarningÚ_NoValueÚ
_is_loadedz'Reloading numpy._globals is not allowedTc               @   s   e Zd ZdZdS )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   ú2/tmp/pip-unpacked-wheel-4ferv4jf/numpy/_globals.pyr       s   Znumpyc               @   s   e Zd ZdZdS )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.

    N)r	   r
   r   r   r   r   r   r   r   .   s   c                   s4   e Zd ZdZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )	Ú_NoValueTypezÂSpecial keyword value.

    The instance of this class may be used as the default value assigned to a
    deprecated keyword in order to check if it has been given a user defined
    value.
    Nc                s   | j stt| ƒj| ƒ| _ | j S )N)Ú_NoValueType__instanceÚsuperr   Ú__new__)Úcls)Ú	__class__r   r   r   C   s    z_NoValueType.__new__c             C   s
   | j f fS )N)r   )Úselfr   r   r   Ú
__reduce__J   s    z_NoValueType.__reduce__c             C   s   dS )Nz
<no value>r   )r   r   r   r   Ú__repr__M   s    z_NoValueType.__repr__)	r	   r
   r   r   r   r   r   r   Ú__classcell__r   r   )r   r   r   ;   s
   r   N)r   Ú
__future__r   r   r   Z__ALL__ÚglobalsÚRuntimeErrorr   ÚDeprecationWarningr   r
   ÚUserWarningr   Úobjectr   r   r   r   r   r   Ú<module>   s   


