Skip to content

About

Pattern matching helpers

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Pattern Utils

PyPI version

See documentation.

Pattern matching utilities. Currently the only implemented matcher is for generators/iterators.

Install

pip install pattern-utils

Example

from pattern_utils import generator as gen


def example_generator():
    yield "some resource"
    return "done"


match gen.matcher(example_generator()):
    case gen.Node(resource, gen.Empty(end_result)):
        print(resource, end_result)

About

Pattern matching helpers

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages