Skip to content

Conversation

@tdg5
Copy link

@tdg5 tdg5 commented Feb 18, 2024

Y'all may have a reason for not defining the return type of ContainerProtocol.register, but if so, I didn't pick up on it.

Here I propose making ContainerProtocol.register return Self. This matches what Container.register does and allows a chaining of registrations of like

container.register(...).register(...).register(...)

Honestly, I don't care and am equally happy with None, but a tighter bound than Any seems beneficial to maintaining portability across container implementations.

@RobertoPrevato
Copy link
Member

Hi @tdg5
Sorry for replying so late. The reason why I didn't specify return self in the ContainerProtocol is only to keep simple the protocol that can be used to replace rodi with alternative implementations of DI in applications like BlackSheep apps.
But I like your idea and I am considering to merge. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants