Skip to content

Commit 33b4afc

Browse files
committed
fix larray-project#864 : added type hints for returned objects from functions and methods.
1 parent 171f1a7 commit 33b4afc

23 files changed

+746
-673
lines changed

larray/core/array.py

Lines changed: 244 additions & 234 deletions
Large diffs are not rendered by default.

larray/core/axis.py

Lines changed: 111 additions & 102 deletions
Large diffs are not rendered by default.

larray/core/constants.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import numpy as np
22

33

4-
nan = np.nan
4+
nan: float = np.nan
55
r"NaN (Not a Number)"
66

7-
inf = np.inf
7+
inf: float = np.inf
88
r":math:`\infty` (infinite)"
99

10-
pi = np.pi
10+
pi: float = np.pi
1111
r":math:`\pi`"
1212

13-
e = np.e
13+
e: float = np.e
1414
r":math:`e`"
1515

16-
euler_gamma = np.euler_gamma
16+
euler_gamma: float = np.euler_gamma
1717
r"Euler's :math:`\gamma`"

larray/core/expr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def expr_eval(expr, context):
7070

7171

7272
class BinaryOp(ExprNode):
73-
def __init__(self, op, expr1, expr2):
73+
def __init__(self, op, expr1, expr2) -> None:
7474
self.op = op
7575
self.expr1 = expr1
7676
self.expr2 = expr2
@@ -83,7 +83,7 @@ def evaluate(self, context):
8383

8484

8585
class UnaryOp(ExprNode):
86-
def __init__(self, op, expr):
86+
def __init__(self, op, expr) -> None:
8787
self.op = op
8888
self.expr = expr
8989

0 commit comments

Comments
 (0)