Skip to content

Commit

Permalink
fix list formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DRMacIver committed Mar 20, 2015
1 parent 2a6b170 commit c7f5e1e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions docs/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ not on reified data.

This has several major advantages:

1. The templates can be of a much more restricted type than the desired output
- you can require them to be immutable, serializable, hashable, etc without in
any way restricting the range of data that you can generate.
2. Seamless support for mutable data: Because the mutable object you produce is
the result of reifying the template, any mutation done by the function you call
does not affect the underlying template.
3. Generation strategies can be made functorial (and indeed applicative. You can
sortof make them monadic but the resulting templates are a bit fiddly and can't
really be of the desired restricted type, so it's probably not really worth it)
1. The templates can be of a much more restricted type than the desired output - you can require them to be immutable, serializable, hashable, etc without in any way restricting the range of data that you can generate.
2. Seamless support for mutable data: Because the mutable object you produce is the result of reifying the template, any mutation done by the function you call does not affect the underlying template.
3. Generation strategies can be made functorial (and indeed applicative. You can sortof make them monadic but the resulting templates are a bit fiddly and can't really be of the desired restricted type, so it's probably not really worth it)

The latter is worth elaborating on: Hypothesis SearchStrategy has a method map
which lets you do e.g. strategy(int).map(lamda x: Decimal(x) / 100). This gives
Expand Down

0 comments on commit c7f5e1e

Please sign in to comment.