You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
svcs will always be non-magical by default, but I guess nothing speaks against adding a helper that makes the lambda superfluous by looking at the type hints of the factory and calling svcs_container.(a)get on the required types automatically:
Since this would only be a helper, it wouldn't also have the pressure to implement all edge cases because the escape hatch of just writing your own lambda is always there.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As it just came up in #86, I use a pattern similar to this all the time:
svcs will always be non-magical by default, but I guess nothing speaks against adding a helper that makes the lambda superfluous by looking at the type hints of the factory and calling
svcs_container.(a)get
on the required types automatically:Since this would only be a helper, it wouldn't also have the pressure to implement all edge cases because the escape hatch of just writing your own lambda is always there.
Beta Was this translation helpful? Give feedback.
All reactions