SpectatorPage.vargs#
- property SpectatorPage.vargs: dict[source]#
A dictionary of additional arguments passed on the class upon initialization. Can be defined as a class attribute.
As a special feature, you can use dot notation to access (but not to set) values on this dictionary.
Examples
Example of definig the vargs as a class attribute on a page:
import alfred3 as al exp = al.Experiment() @exp.member class Demo(al.Page): vargs = {"variable_argument": "demo"} def on_exp_access(self): self += al.Text(self.vargs.variable_argument)
Example of using the vargs in page instantiation:
import alfred3 as al exp = al.Experiment() class TestPage(al.Page): def on_exp_access(self): self += al.Text(f"{self.vargs.test}") @exp.member class Test(al.Section): def on_exp_access(self): for i in range(3): self += TestPage(name=f"p{i}", vargs={"test": 123})