File tree Expand file tree Collapse file tree
crates/processing_pyo3/mewnala Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from .mewnala import *
22
3- # re-export the native submodules as submodules of this module, if they exist
4- # this allows users to import from `mewnala.math` and `mewnala.color`
5- # if they exist, without needing to know about the internal structure of the native module
63import sys as _sys
74from . import mewnala as _native
8- for _name in ("math" , "color" ):
9- _sub = getattr (_native , _name , None )
10- if _sub is not None :
11- _sys .modules [f"{ __name__ } .{ _name } " ] = _sub
5+
6+ _color = getattr (_native , "color" , None )
7+ if _color is not None :
8+ _sys .modules [f"{ __name__ } .color" ] = _color
9+
10+ from . import math # noqa: E402 (Python submodule, extends native math)
11+ from .math import * # noqa: E402,F401,F403
1212
1313# 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
14+ # we dispatch to get attr and call the underlying getter method
1515
1616_DYNAMIC_GRAPHICS_ATTRS = (
1717 "width" ,
@@ -69,6 +69,3 @@ def __getattr__(name):
6969
7070def __dir__ ():
7171 return sorted (set (list (globals ().keys ()) + list (_DYNAMIC )))
72-
73-
74- del _sys , _name , _sub
You can’t perform that action at this time.
0 commit comments