From 1f715958f930e6cb75ee1d5a099c0ea5e1f748dc Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Mon, 4 Aug 2003 05:09:23 +0000 Subject: [PATCH] Fixed get_slice [SVN r19421] --- include/boost/python/indexing/vector_indexing_suite.hpp | 2 +- test/vector_indexing_suite.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/python/indexing/vector_indexing_suite.hpp b/include/boost/python/indexing/vector_indexing_suite.hpp index 76cb7532..f054c6f8 100644 --- a/include/boost/python/indexing/vector_indexing_suite.hpp +++ b/include/boost/python/indexing/vector_indexing_suite.hpp @@ -64,7 +64,7 @@ namespace boost { namespace python { static object get_slice(Container& container, index_type from, index_type to) { - return object(Container(container.begin(), container.end())); + return object(Container(container.begin()+from, container.begin()+to)); } static void diff --git a/test/vector_indexing_suite.py b/test/vector_indexing_suite.py index 39d0dd06..e177aeea 100644 --- a/test/vector_indexing_suite.py +++ b/test/vector_indexing_suite.py @@ -111,8 +111,8 @@ foo ##################################################################### >>> sl = v[0:2] ->>> print_xvec(v) -[ yaba c d foo ] +>>> print_xvec(sl) +[ yaba c ] >>> sl[0].reset() >>> sl[0] reset