Skip to content

Instantly share code, notes, and snippets.

@codecakes
Last active December 9, 2020 14:13
Show Gist options
  • Save codecakes/03b31f77df5d760341b4fd8c140973ad to your computer and use it in GitHub Desktop.
Save codecakes/03b31f77df5d760341b4fd8c140973ad to your computer and use it in GitHub Desktop.
OOPS..I did it again
def executor(driver_out):
return f"this is %s" %driver_out
def connector(driver):
return executor(driver())
def blaster_driver():
return "very important blasting info"
def contractor_driver():
return "very shallow contracting info"
def msg_packet(connector: object, driver):
return connector(driver)
partialExecutor = functools.partial(msg_packet, connector)
print(partialExecutor(blaster_driver))
>> this is very important blasting info
print(partialExecutor(contractor_driver))
>> this is very shallow contracting info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment