From f7d305145c7619b189dc5366a3805cf12c78222e Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 24 Feb 2010 17:21:15 -0300 Subject: [PATCH] fix for slice assignment --- Cython/Compiler/ExprNodes.py | 2 +- tests/run/slice2b.pyx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/run/slice2b.pyx diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 1f0a687c..209c1a80 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2279,7 +2279,7 @@ class SliceIndexNode(ExprNode): self.base.py_result(), self.start_code(), self.stop_code(), - rhs.result())) + rhs.py_result())) else: start_offset = '' if self.start: diff --git a/tests/run/slice2b.pyx b/tests/run/slice2b.pyx new file mode 100644 index 00000000..3e56b3f8 --- /dev/null +++ b/tests/run/slice2b.pyx @@ -0,0 +1,14 @@ +cdef extern from *: + ctypedef class __builtin__.list [ object PyListObject ]: + pass + +def slice_of_typed_value(): + + """ + >>> slice_of_typed_value() + [1, 2, 3] + """ + cdef object a = [] + cdef list L = [1, 2, 3] + a[:] = L + return a -- 2.26.2