Skip to content

Commit

Permalink
Make it easy to check whether a graph already contains a task with th…
Browse files Browse the repository at this point in the history
…e given name.
  • Loading branch information
tshead committed Oct 22, 2020
1 parent 0cd3a49 commit eca3076
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions graphcat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def __init__(self):
self._on_update = blinker.Signal()


def __contains__(self, name):
return name in self._graph


def _require_valid_names(self, names):
if names is None:
return self.tasks()
Expand Down

0 comments on commit eca3076

Please sign in to comment.