Skip to content

Instantly share code, notes, and snippets.

@danishabdullah
Created February 11, 2016 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danishabdullah/a4a71d5f46094b7570d4 to your computer and use it in GitHub Desktop.
Save danishabdullah/a4a71d5f46094b7570d4 to your computer and use it in GitHub Desktop.
Cast for postgres IN statement
def cast_for_in_statement(iterable):
    iterable = ["'{}'".format(n) for n in iterable]
    return "({})".format(", ".join(iterable))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment