Re:Your DI framework is killing your code
by buffoon on Tuesday September 29, 2015 @10:30AM
(#10296517)
This is pretty much how we deal with this in a DI framework anyway. The constructor of the transport takes the host and the send method takes the message.
emailSender = SMTPSender(host='localhost') # in container
emailSender.send(message) # in implementation
The consumer of the SMTPSender only interacts with the send() method.
With currying, you do away with OO and parameter initialization altogether.