2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

New implementation, tests, and documentation for a PySliceObject

objectmanager.


[SVN r22192]
This commit is contained in:
Jonathan Brandmeyer
2004-02-07 21:38:24 +00:00
parent 53268000e7
commit 8452e275d0
11 changed files with 686 additions and 9 deletions

38
src/slice.cpp Normal file
View File

@@ -0,0 +1,38 @@
#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 {
slice::slice()
: object( boost::python::detail::new_reference(
PySlice_New( NULL, NULL, NULL)))
{
}
object
slice::start()
{
return object( detail::borrowed_reference(
((PySliceObject*)this->ptr())->start));
}
object
slice::stop()
{
return object( detail::borrowed_reference(
((PySliceObject*)this->ptr())->stop));
}
object
slice::step()
{
return object( detail::borrowed_reference(
((PySliceObject*)this->ptr())->step));
}
} } // !namespace boost::python