Skip to content

Commit 23f3cbc

Browse files
add type annotations
1 parent 429f514 commit 23f3cbc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pythonbpf/helper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .helper_utils import HelperHandlerRegistry
22
from .bpf_helper_handler import handle_helper_call
33

4-
__all__ = [HelperHandlerRegistry, handle_helper_call]
4+
__all__ = ["HelperHandlerRegistry", "handle_helper_call"]

pythonbpf/helper/helper_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import ast
22
import logging
3+
from collections.abc import Callable
4+
35
from llvmlite import ir
46
from pythonbpf.expr_pass import eval_expr
57

@@ -9,7 +11,7 @@
911
class HelperHandlerRegistry:
1012
"""Registry for BPF helpers"""
1113

12-
_handlers = {}
14+
_handlers: dict[str, Callable] = {}
1315

1416
@classmethod
1517
def register(cls, helper_name):

0 commit comments

Comments
 (0)