Python 3.X compatibility tools.
While this file was originally intended for Python 2 -> 3 transition, it is now used to create a compatibility layer between different minor versions of Python 3.
While the active version of numpy may not support a given version of python, we allow downstream libraries to continue to use these shims for forward compatibility with numpy while they transition their code to newer versions of Python.
Variable | integer_types |
Undocumented |
Variable | strchar |
Undocumented |
Class | contextlib_nullcontext |
Context manager that does no additional processing. |
Function | asbytes |
Undocumented |
Function | asbytes_nested |
Undocumented |
Function | asstr |
Undocumented |
Function | asunicode |
Undocumented |
Function | asunicode_nested |
Undocumented |
Function | getexception |
Undocumented |
Function | is_pathlib_path |
Check whether obj is a pathlib.Path object. |
Function | isfileobj |
Undocumented |
Function | npy_load_module |
Load a module. Uses load_module which will be deprecated in python 3.12. An alternative that uses exec_module is in numpy.distutils.misc_util.exec_mod_from_location |
Function | open_latin1 |
Undocumented |
Function | sixu |
Undocumented |
Check whether obj is a pathlib.Path
object.
Prefer using isinstance(obj, os.PathLike) instead of this function.
Load a module. Uses load_module which will be deprecated in python 3.12. An alternative that uses exec_module is in numpy.distutils.misc_util.exec_mod_from_location
mod : module