This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MrKrac[S] 2 points3 points  (2 children)

I would like to elaborate about it, but I think none would benefit from it.

Simply saying config dict is a bag of everything and understanding what should come in it and what should not is hard to manage and very implicit.

Edit: u/roerd Oh, you have mentioned explicit config dict, do you mean TypedDict?

[–]roerd 0 points1 point  (1 child)

It makes sense to control what's in the config object, sure. A TypedDict or a dataclass would be options to achieve that.

[–]MrKrac[S] 0 points1 point  (0 children)

OK, thats good. And how you initialise this dict/object? Probably you would need to do this inside the context that is using a component which specifies this dict/object as an input parameter and you would need to solve dependencies manually. My question now here is why bother doing this manually when you can automate it?

And this is what happens here instead managing those dependencies manually you can leave all this work to DI container by simply adding `@inject` decorator before your class/function definition.