cf.Field.extract

Field.extract(*args, **kwargs)

Return the instance if it matches the given conditions.

Equivalent to:

def extract(f, *args, **kwargs):
    if f.match(*args, **kwargs):
        return f
    raise ValueError('')
Parameters :
args, kwargs :

As for the match method.

Returns :
out :

The variable as an object identity, if it matches the given conditions.

Raises :
ValueError :

If the variable does not match the conditions.

Previous topic

cf.Field.expand_dims

Next topic

cf.Field.getattr

This Page