def simple_classes(defaults=None):
"""
Return a strategy that yields tuples of simple classes and values to
instantiate them.
"""
return lists_of_attrs(defaults).flatmap(_create_hyp_class)
# Ok, so st.recursive works by taking a base strategy (in this case,
# simple_classes) and a special function. This function receives a strategy,
# and returns another strategy (building on top of the base strategy).
评论列表
文章目录