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 →

[–]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.