Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ailabs-software/4519144 to your computer and use it in GitHub Desktop.
Save ailabs-software/4519144 to your computer and use it in GitHub Desktop.
Why can't I use Python conditionals to select the function to invoke to return the value to .append()?
def writeConfigString(endpointsTuple):
for endpoint in endpointsTuple:
generatedLines.append( (if ENDPOINT_TYPE['STATIC'] == endpoint['type'] generateStaticEndpoint else if ENDPOINT_TYPE['SERVICE'] == endpoint['type'] else None)(endpoint['uri'], endpoint['destination']) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment