@composite
和flatmap
。据我所知,前者可以做任何事,后者可以做。但是,numpy arrays
策略的implementation谈到了一些隐性成本
# We support passing strategies as arguments for convenience,or at least
# for legacy reasons,but don't want to pay the perf cost of a composite
# strategy (i.e. repeated argument handling and validation) when it's not
# needed. So we get the best of both worlds by recursing with flatmap,# but only when it's actually needed.
我认为表示收缩行为更糟,但是我不确定,并且在其他任何地方也找不到此文件。因此,什么时候应该使用@composite
,什么时候flatmap
以及什么时候应该像上面链接的实现中那样走这条中间路线?