rightarrow.parser.Parser.parse

Here are the examples of the python api rightarrow.parser.Parser.parse taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: python-rightarrow Source File: enforce.py
Function: check
def check(ty, val):
    "Checks that `val` adheres to type `ty`"
    
    if isinstance(ty, basestring):
        ty = Parser().parse(ty)

    return ty.enforce(val)