mirror of https://github.com/m-labs/artiq.git
language/core: reduce namespace pollution
This commit is contained in:
parent
5fe3cffc84
commit
3249b8ad3e
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue