pipda.utils
Provide utilities
Classes
PipeableCallCheckWarning
— Warns when checking verb is called normally or using piping</>MultiImplementationsWarning
— Warns when multiple implementations are found</>PipeableCallCheckError
— Raises when checking verb is called normally or using piping</>TypeHolder
— A holder for a type that indicates the function passed toregister_verb or register_func is a placeholder (typically raising NotImplementedError), not a real implementation. </>
Functions
evaluate_expr
(
expr
,data
,context
)
(any) — Evaluate a mixed expression</>has_expr
(
expr
)
(bool) — Check if expr has any Expression object in it</>is_piping
(
pipeable
,fallback
)
(bool) — Check if the pipeable is called with piping.</>update_user_wrapper
(
x
,name
,qualname
,doc
,module
)
— Update the wrapper with user specified values</>
class
pipda.utils.
PipeableCallCheckWarning
(
)
Bases
Warning
Exception
BaseException
Warns when checking verb is called normally or using piping
class
pipda.utils.
MultiImplementationsWarning
(
)
Bases
Warning
Exception
BaseException
Warns when multiple implementations are found
class
pipda.utils.
PipeableCallCheckError
(
)
Bases
Exception
BaseException
Raises when checking verb is called normally or using piping
class
pipda.utils.
TypeHolder
(
)
A holder for a type that indicates the function passed toregister_verb or register_func is a placeholder (typically raising NotImplementedError), not a real implementation.
function
pipda.utils.
update_user_wrapper
(
x
, name
, qualname
, doc
, module
)
Update the wrapper with user specified values
function
pipda.utils.
is_piping
(
pipeable
, fallback
)
Check if the pipeable is called with piping.
Example
>>> data >> verb(...)>>> data >>= verb(...)
Parameters
pipeable
(str) — The name of the verb, used in warning or exception messagingfallback
(str) — What if the AST node fails to retrieve?piping - Suppose this verb is called likedata >> verb(...)
normal - Suppose this verb is called likeverb(data, ...)
piping_warning - Suppose piping call, but show a warning normal_warning - Suppose normal call, but show a warning raise - Raise an error
Returns (bool)
True if it is a piping verb call, otherwise False
function
pipda.utils.
evaluate_expr
(
expr
, data
, context
)
→ any
Evaluate a mixed expression
function
pipda.utils.
has_expr
(
expr
)
→ bool
Check if expr has any Expression object in it