2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 04:22:16 +00:00

Avoid degrading slice to object in generated sig

This commit is contained in:
Jakob van Santen
2023-04-26 21:03:32 +02:00
committed by Stefan Seefeld
parent c4e3b13dc2
commit d1910f3d65
2 changed files with 12 additions and 0 deletions

View File

@@ -34,4 +34,14 @@ slice_base::step() const
((PySliceObject*)this->ptr())->step));
}
static struct register_slice_pytype_ptr
{
register_slice_pytype_ptr()
{
const_cast<converter::registration &>(
converter::registry::lookup(boost::python::type_id<boost::python::slice>())
).m_class_object = &PySlice_Type;
}
}register_slice_pytype_ptr_;
} } } // !namespace boost::python::detail

View File

@@ -33,6 +33,8 @@ test passed
0
>>> check_slice_get_indices( slice( -2, -5, -2))
6
>>> check_slice_get_indices.__doc__.strip().split('\\n')[0]
'check_slice_get_indices( (slice)arg1) -> int :'
"""
# Performs an affirmative and negative argument resolution check.