Commit 4899f187 authored by Kirill Smelkov's avatar Kirill Smelkov

py2: kpi: Add @staticmethod in between @func and __new__

Else on py2 it breaks as e.g.

    TypeError: unbound method __new__() must be called with Measurement instance as first argument (got type instance instead)

On py3 it works ok without explicit @staticmethod -> probably something
to fix on pygolang side.
parent 3820fd0a
......@@ -223,6 +223,7 @@ class Interval(np.void):
# Measurement() creates new Measurement instance with all data initialized to NA.
@func(Measurement)
@staticmethod
def __new__(cls):
m = _newscalar(cls, cls._dtype)
for field in m._dtype0.names:
......@@ -697,6 +698,7 @@ def _miter(calc): # -> iter(Measurement)
# Interval(lo,hi) creates new interval with specified boundaries.
@func(Interval)
@staticmethod
def __new__(cls, lo, hi):
i = _newscalar(cls, cls._dtype)
i['lo'] = lo
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment