Skip to content

Commit 86dc064

Browse files
tychedeliacatilac
authored andcommitted
Add additional math methods.
1 parent 5bceba5 commit 86dc064

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

crates/processing_pyo3/mewnala/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55
# the internal structure of the native module
66
import sys as _sys
77
from . import mewnala as _native
8+
89
for _name in ("math",):
910
_sub = getattr(_native, _name, None)
1011
if _sub is not None:
1112
_sys.modules[f"{__name__}.{_name}"] = _sub
1213

14+
_color = getattr(_native, "color", None)
15+
if _color is not None:
16+
_sys.modules[f"{__name__}.color"] = _color
17+
18+
from . import math # noqa: E402 (Python submodule, extends native math)
19+
from .math import * # noqa: E402,F401,F403
20+
1321
# global var handling. for wildcard import of our module, we copy into globals, otherwise
14-
# we dispatch to get attr and call the underlying getter method
22+
# we dispatch to get attr and call the underlying getter method
1523

1624
_DYNAMIC_GRAPHICS_ATTRS = (
1725
"width",
@@ -106,7 +114,6 @@ def __getattr__(name):
106114
def __dir__():
107115
return sorted(set(list(globals().keys()) + list(_DYNAMIC)))
108116

109-
110117
__all__ = sorted(
111118
{n for n in dir(_native) if not n.startswith("_")} | set(_DYNAMIC)
112119
)

0 commit comments

Comments
 (0)