|
@@ -50,30 +50,19 @@ class HaxeIterator<T>
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+@:preCode("import sys as _hx_sys")
|
|
|
class Lib
|
|
|
{
|
|
|
- /*
|
|
|
- public static inline function assert(value:Dynamic)
|
|
|
- {
|
|
|
- untyped __assert__(value);
|
|
|
- }
|
|
|
-
|
|
|
- public static function random(max:Int)
|
|
|
- {
|
|
|
- var r = new dart.math.Random(); //TODO(av) benchmark / test caching Random instance as static
|
|
|
- return r.nextInt(max);
|
|
|
- }
|
|
|
- */
|
|
|
|
|
|
public static function print(v:Dynamic):Void {
|
|
|
var str = Std.string(v);
|
|
|
- untyped __python__('sys.stdout.buffer.write(("%s"%str).encode(\'utf-8\'))');
|
|
|
+
|
|
|
+ untyped __python__('_hx_sys.stdout.buffer.write(("%s"%str).encode(\'utf-8\'))');
|
|
|
}
|
|
|
|
|
|
public static function println(v:Dynamic):Void {
|
|
|
var str = Std.string(v);
|
|
|
- untyped __python__('sys.stdout.buffer.write(("%s\\n"%str).encode(\'utf-8\'))');
|
|
|
+ untyped __python__('_hx_sys.stdout.buffer.write(("%s\\n"%str).encode(\'utf-8\'))');
|
|
|
}
|
|
|
|
|
|
public static function toPythonIterable <T>(it:Iterable<T>):python.lib.Types.NativeIterable<T>
|