package python; import python.NativeIterable.NativeIterableRaw; /** This type represents native python iterators. It supports automatic conversion to haxe `Iterator` by creating wrapper object. **/ abstract NativeIterator(NativeIteratorRaw) to NativeIteratorRaw to NativeIterable { public inline function new(p:NativeIteratorRaw) this = p; /** Return haxe `Iterator` object by wrapping `this` native iterator. **/ @:to public inline function toHaxeIterator():HaxeIterator return new HaxeIterator(this); } /** Native python iterator protocol. **/ typedef NativeIteratorRaw = { >NativeIterableRaw, function __next__():T; }