pg.is_abstract¶
Accessible via pg.is_abstract
, pg.symbolic.is_abstract
.
- is_abstract(x)[source]¶
Returns if the input value is abstract.
Example:
@pg.symbolize class Foo: def __init__(self, x): pass class Bar(pg.PureSymbolic): pass assert not pg.is_abstract(1) assert not pg.is_abstract(Foo(1)) assert pg.is_abstract(Foo.partial()) assert pg.is_abstract(Bar()) assert pg.is_abstract(Foo(Bar())) assert pg.is_abstract(Foo(pg.oneof([1, 2])))
- Return type:
- Parameters:
x – Value to query against.
- Returns:
True if value itself is partial/PureSymbolic or its child and nested child fields contain partial/PureSymbolic values.