aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/Cython/Compiler/Pythran.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/cython/Cython/Compiler/Pythran.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler/Pythran.py')
-rw-r--r--contrib/tools/cython/Cython/Compiler/Pythran.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/Pythran.py b/contrib/tools/cython/Cython/Compiler/Pythran.py
index c02704a918..7fa3e0cbab 100644
--- a/contrib/tools/cython/Cython/Compiler/Pythran.py
+++ b/contrib/tools/cython/Cython/Compiler/Pythran.py
@@ -9,18 +9,18 @@ import cython
try:
import pythran
pythran_is_pre_0_9 = tuple(map(int, pythran.__version__.split('.')[0:2])) < (0, 9)
- pythran_is_pre_0_9_6 = tuple(map(int, pythran.__version__.split('.')[0:3])) < (0, 9, 6)
+ pythran_is_pre_0_9_6 = tuple(map(int, pythran.__version__.split('.')[0:3])) < (0, 9, 6)
except ImportError:
pythran = None
pythran_is_pre_0_9 = True
- pythran_is_pre_0_9_6 = True
-
-if pythran_is_pre_0_9_6:
- pythran_builtins = '__builtin__'
-else:
- pythran_builtins = 'builtins'
+ pythran_is_pre_0_9_6 = True
+if pythran_is_pre_0_9_6:
+ pythran_builtins = '__builtin__'
+else:
+ pythran_builtins = 'builtins'
+
# Pythran/Numpy specific operations
def has_np_pythran(env):
@@ -54,7 +54,7 @@ def pythran_type(Ty, ptype="ndarray"):
if Ty.is_pythran_expr:
return Ty.pythran_type
#if Ty.is_none:
- # return "decltype(pythonic::builtins::None)"
+ # return "decltype(pythonic::builtins::None)"
if Ty.is_numeric:
return Ty.sign_and_name()
raise ValueError("unsupported pythran type %s (%s)" % (Ty, type(Ty)))
@@ -89,9 +89,9 @@ def _index_type_code(index_with_type):
idx, index_type = index_with_type
if idx.is_slice:
n = 2 + int(not idx.step.is_none)
- return "pythonic::%s::functor::slice{}(%s)" % (
- pythran_builtins,
- ",".join(["0"]*n))
+ return "pythonic::%s::functor::slice{}(%s)" % (
+ pythran_builtins,
+ ",".join(["0"]*n))
elif index_type.is_int:
return "std::declval<%s>()" % index_type.sign_and_name()
elif index_type.is_pythran_expr:
@@ -163,7 +163,7 @@ def to_pythran(op, ptype=None):
if is_type(op_type, ["is_pythran_expr", "is_numeric", "is_float", "is_complex"]):
return op.result()
if op.is_none:
- return "pythonic::%s::None" % pythran_builtins
+ return "pythonic::%s::None" % pythran_builtins
if ptype is None:
ptype = pythran_type(op_type)
@@ -216,7 +216,7 @@ def include_pythran_generic(env):
env.add_include_file("pythonic/types/bool.hpp")
env.add_include_file("pythonic/types/ndarray.hpp")
env.add_include_file("pythonic/numpy/power.hpp")
- env.add_include_file("pythonic/%s/slice.hpp" % pythran_builtins)
+ env.add_include_file("pythonic/%s/slice.hpp" % pythran_builtins)
env.add_include_file("<new>") # for placement new
for i in (8, 16, 32, 64):