Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created November 29, 2015 10:08
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 zeffii/7979b80c1dd61d3028c3 to your computer and use it in GitHub Desktop.
Save zeffii/7979b80c1dd61d3028c3 to your computer and use it in GitHub Desktop.
layout_dict["links"] = [(f_n, f_s, t_n, t_s) for f_n, f_s, t_n, t_s in links
if set((f_n, t_n)).isdisjoint(reroutes)]
# vs
FN = 0
TN = 2
layout_dict["links"] = [tuple(d) for d in links if set((d[FN], d[TN])).isdisjoint(reroutes)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment