stories icon indicating copy to clipboard operation
stories copied to clipboard

State union should merge different Argument declarations.

Open proofit404 opened this issue 4 years ago • 2 comments

class A1State(State):
    a1v1 = Argument()

class A2State(State):
    a2v1 = Argument()

NewState = A1State & A2State

The NewState would have both a1v1 and a2v1 arguments declared.

If name was declared as argument at least in one State of the union, it will be allowed to be used as an argument. Even if in other states it was declared as variable.

proofit404 avatar Apr 03 '21 01:04 proofit404

Having a union of many states could look awful with chosen syntax.

state_class = (
    A1State
    & A2State
    & A3State
    & A4State
    & A5State
    & A6State
    & A7State
    & A8State
    & A9State
    & A10State
)
state_class = Union(
    A1State,
    A2State,
    A3State,
    A4State,
    A5State,
    A6State,
    A7State,
    A8State,
    A9State,
    A10State,
)

proofit404 avatar Jun 27 '22 13:06 proofit404

Even more boilerplate could be reduced if we would be able to merge all state subclasses from different namespaces.

state_class = Union(cases.usecases.scopes, bot.usecases.scopes)

proofit404 avatar Jun 28 '22 07:06 proofit404

Superseded by #722

proofit404 avatar Nov 05 '22 15:11 proofit404