Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 4, 2020 18:02
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 deque-blog/99d51aef91e838bfff56974724c43a5e to your computer and use it in GitHub Desktop.
Save deque-blog/99d51aef91e838bfff56974724c43a5e to your computer and use it in GitHub Desktop.
@classmethod
def compile(cls, pattern: str):
nodes = []
stars = []
for c in pattern:
if c == "*":
stars[-1] = True
else:
nodes.append(c)
stars.append(False)
return cls(nodes=nodes, stars=stars)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment