forked from M-Labs/artiq
1
0
Fork 0

language/core: reduce namespace pollution

This commit is contained in:
Sebastien Bourdeauducq 2014-09-18 16:30:38 +08:00
parent 5fe3cffc84
commit 3249b8ad3e
1 changed files with 5 additions and 5 deletions

View File

@ -21,15 +21,15 @@ for _op_name in ("neg", "pos", "abs", "invert", "round",
"lshift", "rlshift", "rshift", "rrshift", "lshift", "rlshift", "rshift", "rrshift",
"and", "rand", "xor", "rxor", "or", "ror", "and", "rand", "xor", "rxor", "or", "ror",
"floordiv", "rfloordiv", "mod", "rmod"): "floordiv", "rfloordiv", "mod", "rmod"):
method_name = "__" + _op_name + "__" _method_name = "__" + _op_name + "__"
orig_method = getattr(int, method_name) _orig_method = getattr(int, _method_name)
setattr(int64, method_name, _make_int64_op_method(orig_method)) setattr(int64, _method_name, _make_int64_op_method(_orig_method))
for _op_name in ("add", "sub", "mul", "floordiv", "mod", for _op_name in ("add", "sub", "mul", "floordiv", "mod",
"pow", "lshift", "rshift", "lshift", "pow", "lshift", "rshift", "lshift",
"and", "xor", "or"): "and", "xor", "or"):
op_method = getattr(int, "__" + _op_name + "__") _op_method = getattr(int, "__" + _op_name + "__")
setattr(int64, "__i" + _op_name + "__", _make_int64_op_method(op_method)) setattr(int64, "__i" + _op_name + "__", _make_int64_op_method(_op_method))
def round64(x): def round64(x):