Skip to content

Global variables #222

Answered by yaythomas
mtazzari asked this question in Q&A
Mar 11, 2021 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

thanks for you kind words @mtazzari, much appreciated 🙌 !

it's absolutely possible to do what you want. in pypyr the easiest is to use formatting substitution expressions - these support complex types like your own dict/kwarg style arguments.

I normally use the pypyr.steps.default step to set "global" values in context that I want to use later in the pipeline. You can also use pypyr.steps.contextsetf - the only difference is that default only sets the values if they don't exist already, which is handy if you want to combine this with something like the pypyr.parser.keyvaluepairs parser to allow the user to override some of the defaults from the cmd line. contextsetf by comparison, always …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mtazzari
Comment options

@yaythomas
Comment options

@mtazzari
Comment options

@mtazzari
Comment options

@yaythomas
Comment options

Answer selected by mtazzari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants