Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
frogkid3316656dMaybe this is an important clarification - this is an aws lambda
frogkid3316656dDoing a full blown class would decrease performance
Doing strings make a heavier codebase
Passing a dict around feels dirty
VaderNT185756dcollections.namedtuple is yet another option. 😉
LuckierDodge19255dIf I'm understanding the question correctly, I seem to recall settling on throwing dictionaries around as my preferred solution to a similar situation. If memory serves, the way python will handle it is essentially "pass by reference", so there's no big performance implication. And that way you can access multiple keys without having to pass them all individually.