@@ -180,22 +180,25 @@ returns a new strategy for it. So for example:
180
180
>>> json = recursive(none() | booleans() | floats() | text(printable),
181
181
... lambda children : lists(children) | dictionaries(text(printable), children))
182
182
>>> pprint(json.example())
183
- [['P'],
184
- [None,
185
- True,
186
- -inf,
187
- 5.5477328279826776e+16,
188
- True,
189
- None,
190
- -0.3333333333333333,
191
- -1.7093843795721067e-100,
192
- False,
193
- '94K~{mY>a1yA:#CmDYb',
194
- None],
195
- [None, 8.628035772152501e-162, None],
196
- False]
183
+ ['dy',
184
+ [None, True, 6.297399055778002e+16, False],
185
+ {'a{h\\:694K~{mY>a1yA:#CmDYb': None},
186
+ '\\kP!4',
187
+ {'#1J1': '',
188
+ 'cx.': None,
189
+ "jv'A?qyp_sB\n$62g": [],
190
+ 'qgnP': [False, -inf, 'la)']},
191
+ [],
192
+ {}]
197
193
>>> pprint(json.example())
198
- {'': [True]}
194
+ {'': None,
195
+ '(Rt)': 1.192092896e-07,
196
+ ',': [],
197
+ '6': 2.2250738585072014e-308,
198
+ 'HA=/': [],
199
+ 'YU]gy8': inf,
200
+ 'l': None,
201
+ 'nK': False}
199
202
>>> pprint(json.example())
200
203
[]
201
204
@@ -211,7 +214,7 @@ we wanted to only generate really small JSON we could do this as:
211
214
>>> small_lists.example()
212
215
[False]
213
216
>>> small_lists.example()
214
- [ True, True]
217
+ True
215
218
>>> small_lists.example()
216
219
[]
217
220
0 commit comments