summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/boost/libs/python/src/slice.cpp
diff options
context:
space:
mode:
authorDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/restricted/boost/libs/python/src/slice.cpp
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/restricted/boost/libs/python/src/slice.cpp')
-rw-r--r--contrib/restricted/boost/libs/python/src/slice.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/restricted/boost/libs/python/src/slice.cpp b/contrib/restricted/boost/libs/python/src/slice.cpp
new file mode 100644
index 00000000000..ee55f948461
--- /dev/null
+++ b/contrib/restricted/boost/libs/python/src/slice.cpp
@@ -0,0 +1,37 @@
+#include "boost/python/slice.hpp"
+
+// Copyright (c) 2004 Jonathan Brandmeyer
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+namespace boost { namespace python { namespace detail {
+
+slice_base::slice_base(PyObject* start, PyObject* stop, PyObject* step)
+ : object(detail::new_reference( PySlice_New(start, stop, step)))
+{
+}
+
+object
+slice_base::start() const
+{
+ return object( detail::borrowed_reference(
+ ((PySliceObject*)this->ptr())->start));
+}
+
+object
+slice_base::stop() const
+{
+ return object( detail::borrowed_reference(
+ ((PySliceObject*)this->ptr())->stop));
+}
+
+object
+slice_base::step() const
+{
+ return object( detail::borrowed_reference(
+ ((PySliceObject*)this->ptr())->step));
+}
+
+} } } // !namespace boost::python::detail