mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
Merge branch 'python3-iterator' into '0.3.2'
Add __next__ method to follow python3 iterator protocol See merge request pykd/pykd!3
This commit is contained in:
commit
7fa4ec351a
@ -796,7 +796,11 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
python::class_<TargetHeapIterator>("targetHeapIterator", "iterator for typedVar array", python::no_init)
|
||||
.def("__iter__", &TargetHeapIterator::self)
|
||||
.def("__len__", &TargetHeapIterator::length)
|
||||
#if PY_VERSION_HEX < 0x03000000
|
||||
.def("next", &TargetHeapIterator::next)
|
||||
#else
|
||||
.def("__next__", &TargetHeapIterator::next)
|
||||
#endif
|
||||
;
|
||||
|
||||
python::class_<kdlib::TargetHeap, kdlib::TargetHeapPtr, boost::noncopyable>("targetHeap", "Class representing heap in the target process", python::no_init )
|
||||
@ -960,7 +964,11 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
|
||||
python::class_<TypedVarIterator>("typedVarIterator", "iterator for typedVar array", python::no_init)
|
||||
.def("__iter__", &TypedVarIterator::self)
|
||||
#if PY_VERSION_HEX < 0x03000000
|
||||
.def("next", &TypedVarIterator::next)
|
||||
#else
|
||||
.def("__next__", &TypedVarIterator::next)
|
||||
#endif
|
||||
;
|
||||
|
||||
python::class_<kdlib::TypedVar, kdlib::TypedVarPtr, python::bases<kdlib::NumBehavior>, boost::noncopyable >("typedVar",
|
||||
|
Loading…
Reference in New Issue
Block a user