Expose Type Aliases #287
-
Hello everyone. In my application, I have the following setup: class MacroController:
def __init__(self):
self.ahk = AHK()
targets = ["ToolTip", "Pixel", "Mouse", "Caret", "Menu"]
for target in targets:
self.ahk.set_coord_mode(target=target, relative_to="Window") The problem arises because the Union[
Literal["ToolTip"],
Literal["Pixel"],
Literal["Mouse"],
Literal["Caret"],
Literal["Menu"],
] To resolve this, I need to ensure that my targets list has the same definition(or define the same type alias by my own). It would look something like this: targets: list[
Union[
Literal["ToolTip"],
Literal["Pixel"],
Literal["Mouse"],
Literal["Caret"],
Literal["Menu"],
]
] = ["ToolTip", "Pixel", "Mouse", "Caret", "Menu"] It would be even better if I could import the CoordModeTargets type alias from _engine.py, but unfortunately, it's not exposed and i cant import by default. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Update: I just discovered that i can import tipes alises(or anything that i want wich is in engine.py) by using |
Beta Was this translation helpful? Give feedback.
Update: I just discovered that i can import tipes alises(or anything that i want wich is in engine.py) by using
from ahk._sync.engine import CoordModeTargets
or anything else