←back to thread

498 points azhenley | 1 comments | | HN request time: 0.206s | source
Show context
sgarland ◴[] No.45770550[source]
Dumb question from a primarily Python programmer who mostly writes (sometimes lengthy) scripts: if you have a function doing multiple API calls - say, to different AWS endpoints with boto3 - would you be expected to have a different variable for each response? Or do you delete the variable after it’s handled, so the next one is “new?”
replies(3): >>45770602 #>>45770650 #>>45770806 #
1. ForHackernews ◴[] No.45770806[source]
If they're representing different data from different API calls, yeah, I'd be strongly inclined to give them different names.

    order_data = boto.get_from_dynamodb()
    customer_data = boto.get_from_rds()
    branding_assets = boto.get_from_s3()
    return render_for_user(order_data, customer_data, branding_assets, ...)