Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.9/dist-packages/numpy/_utils/__init__.py: 100%
7 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-03 06:39 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-03 06:39 +0000
1"""
2This is a module for defining private helpers which do not depend on the
3rest of NumPy.
5Everything in here must be self-contained so that it can be
6imported anywhere else without creating circular imports.
7If a utility requires the import of NumPy, it probably belongs
8in ``numpy.core``.
9"""
11from ._convertions import asunicode, asbytes
14def set_module(module):
15 """Private decorator for overriding __module__ on a function or class.
17 Example usage::
19 @set_module('numpy')
20 def example():
21 pass
23 assert example.__module__ == 'numpy'
24 """
25 def decorator(func):
26 if module is not None:
27 func.__module__ = module
28 return func
29 return decorator