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:
committed by
Stefan Seefeld
parent
c4e3b13dc2
commit
d1910f3d65
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user