35 lines
834 B
Python
35 lines
834 B
Python
from typing import Any, List
|
|
|
|
|
|
from .valuetype import ValueType
|
|
|
|
|
|
class MethodArgument:
|
|
__slots__ = ('name', 'value_type', )
|
|
|
|
name: str
|
|
value_type: ValueType
|
|
|
|
def __init__(self, name: str, value_type: ValueType) -> None:
|
|
self.name = name
|
|
self.value_type = value_type
|
|
|
|
def __eq__(self, other: Any) -> bool:
|
|
if not isinstance(other, MethodArgument):
|
|
raise NotImplementedError
|
|
|
|
return self.name == other.name and self.value_type == other.value_type
|
|
|
|
|
|
class Method:
|
|
__slots__ = ('name', 'args', 'return_type', )
|
|
|
|
name: str
|
|
args: List[MethodArgument]
|
|
return_type: ValueType
|
|
|
|
def __init__(self, name: str, args: List[MethodArgument], return_type: ValueType) -> None:
|
|
self.name = name
|
|
self.args = args
|
|
self.return_type = return_type
|