@@ -70,7 +70,7 @@ class UndefinedVariableError(NameError):
70
70
NameError subclass for local variables.
71
71
"""
72
72
73
- def __init__ (self , name : str , is_local : bool | None = None ):
73
+ def __init__ (self , name : str , is_local : bool | None = None ) -> None :
74
74
base_msg = f"{ repr (name )} is not defined"
75
75
if is_local :
76
76
msg = f"local variable { base_msg } "
@@ -88,7 +88,7 @@ def __new__(cls, name, env, side=None, encoding=None):
88
88
89
89
is_local : bool
90
90
91
- def __init__ (self , name , env , side = None , encoding = None ):
91
+ def __init__ (self , name , env , side = None , encoding = None ) -> None :
92
92
# name is a str for Term, but may be something else for subclasses
93
93
self ._name = name
94
94
self .env = env
@@ -189,7 +189,7 @@ def ndim(self) -> int:
189
189
190
190
191
191
class Constant (Term ):
192
- def __init__ (self , value , env , side = None , encoding = None ):
192
+ def __init__ (self , value , env , side = None , encoding = None ) -> None :
193
193
super ().__init__ (value , env , side = side , encoding = encoding )
194
194
195
195
def _resolve_name (self ):
@@ -215,7 +215,7 @@ class Op:
215
215
216
216
op : str
217
217
218
- def __init__ (self , op : str , operands : Iterable [Term | Op ], encoding = None ):
218
+ def __init__ (self , op : str , operands : Iterable [Term | Op ], encoding = None ) -> None :
219
219
self .op = _bool_op_map .get (op , op )
220
220
self .operands = operands
221
221
self .encoding = encoding
@@ -375,7 +375,7 @@ class BinOp(Op):
375
375
rhs : Term or Op
376
376
"""
377
377
378
- def __init__ (self , op : str , lhs , rhs ):
378
+ def __init__ (self , op : str , lhs , rhs ) -> None :
379
379
super ().__init__ (op , (lhs , rhs ))
380
380
self .lhs = lhs
381
381
self .rhs = rhs
@@ -530,7 +530,7 @@ class Div(BinOp):
530
530
The Terms or Ops in the ``/`` expression.
531
531
"""
532
532
533
- def __init__ (self , lhs , rhs ):
533
+ def __init__ (self , lhs , rhs ) -> None :
534
534
super ().__init__ ("/" , lhs , rhs )
535
535
536
536
if not isnumeric (lhs .return_type ) or not isnumeric (rhs .return_type ):
@@ -566,7 +566,7 @@ class UnaryOp(Op):
566
566
* If no function associated with the passed operator token is found.
567
567
"""
568
568
569
- def __init__ (self , op : str , operand ):
569
+ def __init__ (self , op : str , operand ) -> None :
570
570
super ().__init__ (op , (operand ,))
571
571
self .operand = operand
572
572
@@ -598,7 +598,7 @@ def return_type(self) -> np.dtype:
598
598
599
599
600
600
class MathCall (Op ):
601
- def __init__ (self , func , args ):
601
+ def __init__ (self , func , args ) -> None :
602
602
super ().__init__ (func .name , args )
603
603
self .func = func
604
604
@@ -614,7 +614,7 @@ def __repr__(self) -> str:
614
614
615
615
616
616
class FuncNode :
617
- def __init__ (self , name : str ):
617
+ def __init__ (self , name : str ) -> None :
618
618
if name not in MATHOPS :
619
619
raise ValueError (f'"{ name } " is not a supported function' )
620
620
self .name = name
0 commit comments