[CM] confusing musx results
Taube, Heinrich K
taube at illinois.edu
Sun Feb 14 13:36:55 PST 2021
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 <treegestalt at gmail.com<mailto:treegestalt at gmail.com>> 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
Cmdist at ccrma.stanford.edu<mailto:Cmdist at ccrma.stanford.edu>
https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!r_XLOy0Q_kK-SX2m4TbaaasUtzVByuEg8n01o7XptHli-jvQsIe6iD8etLI6DA$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210214/806af32b/attachment.html>
More information about the Cmdist
mailing list