This message was deleted.
# hamilton-help
s
This message was deleted.
e
So yes! But some nuance here. You have options: 1. You can return a tuple -- then use that later (and split it up) 2. We have an
extract_fields
tool that will help you out Following code from memory -- will run soon to ensure that it works perfectly. (2) is my favorite -- would look like this:
Copy code
@function_modifiers.extract_fields('d', 'e')
def d_and_e(a: int, b: int, c: int) -> dict:
    return {'d': a+c, 'e' : b+c}
Currently we don't have an extract_items for tuples but that would be reasonable (and we're looking for contributions). For (1) you'd do something like this:
Copy code
def d_and_e(a: int, b: int, c: int) -> tuple:
    return (a+c, b+c)

def d(d_and_e: tuple) ->int:
    return d_and_e[0]

def e(d_and_e: tuple) ->int:
    return d_and_e[1]
Which is IMO a little uglier.