2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00

Make slice work on vc6

Revamp/simplify class registration


[SVN r23823]
This commit is contained in:
Dave Abrahams
2004-07-20 03:16:49 +00:00
parent 2bdb728e87
commit 615adc5fe6
18 changed files with 391 additions and 498 deletions

View File

@@ -6,39 +6,32 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
namespace boost { namespace python {
namespace boost { namespace python { namespace detail {
object
slice::new_slice(PyObject* start, PyObject* stop, PyObject* step)
{
return object(detail::new_reference( PySlice_New(start, stop, step)));
}
slice::slice()
: object( boost::python::detail::new_reference(
PySlice_New( NULL, NULL, NULL)))
slice_base::slice_base(PyObject* start, PyObject* stop, PyObject* step)
: object(detail::new_reference( PySlice_New(start, stop, step)))
{
}
object
slice::start() const
slice_base::start() const
{
return object( detail::borrowed_reference(
((PySliceObject*)this->ptr())->start));
}
object
slice::stop() const
slice_base::stop() const
{
return object( detail::borrowed_reference(
((PySliceObject*)this->ptr())->stop));
}
object
slice::step() const
slice_base::step() const
{
return object( detail::borrowed_reference(
((PySliceObject*)this->ptr())->step));
}
} } // !namespace boost::python
} } } // !namespace boost::python::detail