| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| | | |
| | | | |
MAINT: Replace remaining PyString macros.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Replace remaining npy_3kcompat PyString macros with their definition.
- PyString_AS_STRING -> PyBytes_AS_STRING
- PyString_GET_SIZE -> PyBytes_GET_SIZE
|
| | | |
| | | |
| | | |
| | | | |
Replace the npy_3kcompat macro PyNumber_Int by its definition.
|
|/ / /
| | |
| | |
| | | |
Replace the npy_3kcompat macro PyInt_FromLong by its definition.
|
| | |
| | |
| | |
| | | |
This replaces the npy_3kcompat macro PyStringObject with its definition.
|
| | |
| | |
| | |
| | | |
Replaces the npy_3kcompat PyString_Check macro with its definition.
|
|\ \ \
| | | |
| | | | |
ENH: Add placeholder stubs for all sub-modules
|
| | | | |
|
|\ \ \ \
| | |_|/
| |/| | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We no longer need to use the compatibility function after dropping
support for Python 2.7. In some cases unicode was the correct string
type rather than the bytes of the compatibility version and bugs in the
array `__complex__` and array `__array_interface__` methods have been
fixed by changing that.
|
|/ /
| |
| |
| | |
Unlike the others, PyInt_Check has a special meaning distinc from PyLong_Check, so only the places where the difference doesn't matter have been updated here.
|
| | |
|
| |
| |
| |
| |
| | |
Move compiler thread-local declaration detection to a common macro.
Also support C11 thread_local declaration, if available.
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
In https://github.com/python/cpython/pull/20290 CPython changed
`Py_TYPE` from a macro to an inline function. This requires a code
change to us `Py_SET_TYPE` instead when using `Py_TYPE()` as a lvalue
in c code.
In https://github.com/python/cpython/pull/20429 CPython changed
`Py_SIZE` from a macro to an inline function. This requires a code
change to us `Py_SET_SIZE` instead of using `Py_SIZE` as a lvalue in c
code.
|
| |
|
|
|
|
|
| |
types (#15816)
Cleanup from the dropping of python 2
|
|\
| |
| | |
BUG: don't add 'public' or 'private' if the other one exists
|
| |
| |
| |
| |
| |
| | |
Currently, setting 'public' or 'private' attribute is adding
one even if the other one already exists because of the else:
part that is always appending.
|
|/ |
|
|
|
| |
* BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
|
|
|
|
|
|
|
| |
`global` is only needed if a variable appears on the left of an assignment.
These variables do not.
Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.
|
|\
| |
| | |
MAINT: Fixing typos in f2py comments and code.
|
| | |
|
|/
|
|
| |
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
|
|
|
|
|
|
| |
* Cleanup unused imports (F401) of mostly standard Python modules,
or some internal but unlikely referenced modules
* Where internal imports are potentially used, mark with noqa
* Avoid redefinition of imports (F811)
|
|
|
|
|
|
|
|
|
|
| |
This was not used previously due to it requiring C99. Python
itself acknowledges that it can be used (they do almost not use it
as of now), except inside header files due to C++ compatibility.
See also (Found by Eric Wieser in PR):
https://mail.python.org/pipermail/python-dev/2017-January/147154.html
and PEP 7: https://www.python.org/dev/peps/pep-0007/#c-dialect
|
|
|
| |
More sys.version cleanup.
|
|
|
| |
Revert ed916ff#diff-c9eccf467e5f6561061d6a5ac4730330 which was needed to workaround http://bugs.python.org/issue4720 which was fixed 12 years ago.
|
|
|
|
|
|
|
| |
This replaces basestring with str except in
- tools/npy_tempita/
- numpy/compat/py3k.py
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This means we no longer interpret `MemoryError` or `KeyboardInterrupt` as `keyword arg not provided`, for instance.
This function is python 3 only, hence this was difficult to do in older versions of numpy.
Inspired by https://bugs.python.org/issue35459
|
| |
|
|
|
|
|
|
|
|
| |
* The instance in `_internal` is parsing tuples and integers, so `ast.literal_eval` is just fine
* The instance in `crack_fortran` is just trying to lookup a function name dynamically
* The instance in `f90mod_rules` is looking at the result of `capi_maps.getarrdims(...)['rank']`, which is always a string representation of an integer
The f2py code is still littered with `eval`, but the remaining cases were harder to reason about.
|
| |
|
| |
|
|
|
|
|
|
| |
Marking these arguments as const makes it easier to reason about these functions, and prevent accidental mutation.
The C99 standard (6.2.5/26 "Types") guarantees that ABI compatibility is preserved here.
|
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|\
| |
| | |
MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
|
| | |
|
|\ \
| |/
|/| |
MAINT: Remove unnecessary 'from __future__ import ...' statements
|
| |
| |
| |
| |
| | |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|/
|
|
|
| |
Dropping the support for python 2, the difference in module setup do not have to be accounted
for anymore. This removes the macros and ifdef's related to module setup code and python 2
support.
|
| |
|
|
|
|
|
|
| |
Distutils code needs to run in different temporary directories, probably
because they create `_configtest.c` files for compiler detection in the
current directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, f2py loaded the type mappings from a file ``.f2py_f2cmap``
in current directory, at import time.
Make the file name customizable by adding a ``--f2cmap`` command line
option, and postpone loading the file to f2py.run_main().
Moreover, restore the default type mapping in f2py.run_main() before
loading the customizations, so that multiple calls to f2py.run_main() do
not interfere with each other. (For example, numpy.distutils calls f2py
multiple times in the same process.)
|