yikes that is a documentation error, thanks for finding it!  jumble() returns a 
python generator and so the example needs to use next() to read values from the 
generator:

% python3.9
>>> from musx import jumble
>>> x = jumble([1,2,3])
>>> [next(x) for _ in range(5)]
[3, 2, 1, 2, 1]

i will release a new version in the next day or two.


On Feb 14, 2021, at 2:48 PM, Forrest Curo 
<[email protected]<mailto:[email protected]>> wrote:

documentation says:

>>> [jumble<https://urldefense.com/v3/__http://localhost:40673/musx.generators.html*-jumble__;Iw!!DZ3fjg!r_XLOy0Q_kK-SX2m4TbaaasUtzVByuEg8n01o7XptHli-jvQsIe6iD_OB6fWwQ$>([1,2,3])
>>>  for _ in range(5)]
[1, 1, 3, 2, 3]

but I'm getting:

>>> [musx.jumble([1,2,3,4]) for _ in range(7)]
[<generator object jumble at 0x7ffa8c1c2740>, <generator object jumble at 
0x7ffa8c1c2660>, <generator object jumble at 0x7ffa8c1c27b0>, <generator object 
jumble at 0x7ffa8c1c2820>, <generator object jumble at 0x7ffa8c1c2890>, 
<generator object jumble at 0x7ffa8c1c2900>, <generator object jumble at 
0x7ffa8c1c2970>]

?


_______________________________________________
Cmdist mailing list
[email protected]<mailto:[email protected]>
https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!r_XLOy0Q_kK-SX2m4TbaaasUtzVByuEg8n01o7XptHli-jvQsIe6iD8etLI6DA$

_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Reply via email to