Skip to content

Conversation

@r41k0u
Copy link
Collaborator

@r41k0u r41k0u commented Oct 12, 2025

Fixes #49

@r41k0u r41k0u marked this pull request as ready for review October 12, 2025 20:58
@r41k0u r41k0u requested a review from Copilot October 12, 2025 20:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes a circular dependency issue by implementing dependency inversion to eliminate the delayed import of helper handlers in the expression evaluator. The change introduces a registry pattern that allows the helper module to register its handler with the expression module, rather than the expression module directly importing from the helper module.

  • Introduced a CallHandlerRegistry class in the expression module to manage call handlers
  • Moved helper call handling logic from eval_expr to a registration function in the helper module
  • Replaced delayed imports and direct helper handling with registry-based delegation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pythonbpf/helper/init.py Added registration function that sets up helper call handler with the expression module registry
pythonbpf/expr/expr_pass.py Added CallHandlerRegistry class and simplified eval_expr to use registry delegation
pythonbpf/expr/init.py Exported CallHandlerRegistry to make it available for registration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@r41k0u r41k0u merged commit b0ea93a into master Oct 12, 2025
1 check passed
@varun-r-mallya varun-r-mallya deleted the dep_inv branch November 1, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use dependency inversion to get rid of delayed import in eval_expr

2 participants