mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Consistently use Dataclass syntac for AssignmentInfo and related classes
This commit is contained in:
@ -1,12 +1,11 @@
|
||||
from enum import Enum, auto
|
||||
from typing import Any, Dict, List, Optional, TypedDict
|
||||
from typing import Any, Dict, List, Optional
|
||||
from dataclasses import dataclass
|
||||
import llvmlite.ir as ir
|
||||
|
||||
from pythonbpf.vmlinux_parser.dependency_node import Field
|
||||
|
||||
|
||||
@dataclass
|
||||
class AssignmentType(Enum):
|
||||
CONSTANT = auto()
|
||||
STRUCT = auto()
|
||||
@ -16,7 +15,7 @@ class AssignmentType(Enum):
|
||||
|
||||
|
||||
@dataclass
|
||||
class FunctionSignature(TypedDict):
|
||||
class FunctionSignature:
|
||||
return_type: str
|
||||
param_types: List[str]
|
||||
varargs: bool
|
||||
@ -24,7 +23,7 @@ class FunctionSignature(TypedDict):
|
||||
|
||||
# Thew name of the assignment will be in the dict that uses this class
|
||||
@dataclass
|
||||
class AssignmentInfo(TypedDict):
|
||||
class AssignmentInfo:
|
||||
value_type: AssignmentType
|
||||
python_type: type
|
||||
value: Optional[Any]
|
||||
|
||||
Reference in New Issue
Block a user