- app-model version: 0.2.7
- Python version: 3.11.9
- Operating System: Windows 11
Description
The in_ method seems not working with a constant list.
What I wanted to do was to use a ContextNamespace ctx and make a enablement statement like ctx.window_state.in_(["minimized", "maximized"]). I think I can make it work by defining another ContextKey that always returns a constant list, but I think there should be some easier way to do that.
What I Did
expr = Constant(1).in_(Constant(2)) # <- not working, as a constant is not iterable
expr = Constant(1).in_([1, 2]) # <- not working, as a list is not a constant
expr = Constant(1).in_(ast.List(1, 2)) # <- not working, as a ast.List is not a constant
Description
The
in_method seems not working with a constant list.What I wanted to do was to use a ContextNamespace
ctxand make a enablement statement likectx.window_state.in_(["minimized", "maximized"]). I think I can make it work by defining another ContextKey that always returns a constant list, but I think there should be some easier way to do that.What I Did