PHP 8.0.30
Preview: _globals.py Size: 1.81 KB
/proc/thread-self/root/opt/alt/python37/lib64/python3.7/site-packages/numpy/_globals.py

"""
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.

"""
from __future__ import division, absolute_import, print_function


__ALL__ = [
    'ModuleDeprecationWarning', 'VisibleDeprecationWarning', '_NoValue'
    ]


# Disallow reloading this module so as to preserve the identities of the
# classes defined here.
if '_is_loaded' in globals():
    raise RuntimeError('Reloading numpy._globals is not allowed')
_is_loaded = True


class ModuleDeprecationWarning(DeprecationWarning):
    """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.

    """
    pass


class VisibleDeprecationWarning(UserWarning):
    """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.

    """
    pass


class _NoValue:
    """Special keyword value.

    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.
    """
    pass

Directory Contents

Dirs: 14 × Files: 11

Name Size Perms Modified Actions
compat DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
core DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
distutils DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
doc DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
fft DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
lib DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
linalg DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
ma DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
matrixlib DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
random DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
testing DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
tests DIR
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
- drwxr-xr-x 2023-05-13 02:18:14
Edit Download
222.86 KB lrw-r--r-- 2023-04-24 19:30:10
Edit Download
14.33 KB lrw-r--r-- 2023-04-24 19:30:10
Edit Download
1.82 KB lrw-r--r-- 2023-04-24 19:30:08
Edit Download
9.36 KB lrw-r--r-- 2023-04-24 19:30:09
Edit Download
898 B lrw-r--r-- 2023-04-24 19:30:08
Edit Download
261 B lrw-r--r-- 2023-04-24 19:38:31
Edit Download
331 B lrw-r--r-- 2023-04-24 19:30:10
Edit Download
1.81 KB lrw-r--r-- 2023-04-24 19:30:10
Edit Download
12.95 KB lrw-r--r-- 2023-04-24 19:30:10
Edit Download
1.14 KB lrw-r--r-- 2023-04-24 19:38:32
Edit Download
6.13 KB lrw-r--r-- 2023-04-24 19:30:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).