Skip to content

Commit dea4e10

Browse files
committed
Code cleanup
1 parent ce9bab7 commit dea4e10

File tree

7 files changed

+274
-292
lines changed

7 files changed

+274
-292
lines changed

monic/expressions/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from monic.expressions.registry import (
1212
monic_bind,
1313
monic_bind_module,
14-
register,
15-
register_module,
1614
)
1715

1816

@@ -26,6 +24,4 @@
2624
# Registry
2725
"monic_bind",
2826
"monic_bind_module",
29-
"register",
30-
"register_module",
3127
]

monic/expressions/interpreter.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class ControlFlow:
118118

119119

120120
class ExpressionsInterpreter(ast.NodeVisitor):
121+
"""Interpreter for Monic expressions."""
122+
121123
def __init__(self, context: ExpressionsContext | None = None) -> None:
122124
"""Initialize the interpreter.
123125
@@ -177,7 +179,7 @@ def __init__(self, context: ExpressionsContext | None = None) -> None:
177179
"SecurityError": SecurityError,
178180
}
179181

180-
# Add registered objects to global environment
182+
# Add bound objects in registry to global environment
181183
self.global_env.update(registry.get_all())
182184

183185
# Add built-in decorators
@@ -1657,8 +1659,8 @@ def _call_function(
16571659
if not callable(func):
16581660
raise TypeError(f"'{type(func).__name__}' object is not callable")
16591661

1660-
# Handle registered functions
1661-
if registry.is_registered(func):
1662+
# Handle bound functions
1663+
if registry.is_bound(func):
16621664
return func(*pos_args, **kwargs)
16631665

16641666
# Handle bound methods
@@ -2121,8 +2123,8 @@ def _should_bind_function(
21212123
Returns:
21222124
Whether the function should be bound
21232125
"""
2124-
# Check if this is a registered function
2125-
if registry.is_registered(func):
2126+
# Check if this is a bound function
2127+
if registry.is_bound(func):
21262128
return False
21272129

21282130
# Check if this is a static method

monic/expressions/parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010

1111
class ExpressionsParser:
12+
"""Parser for Monic expressions."""
13+
1214
def __init__(self) -> None:
1315
pass
1416

0 commit comments

Comments
 (0)