skulpt / skulpt

Skulpt is a Javascript implementation of the Python programming language
Other
3.34k stars 894 forks source link

Adds random.choices to the random module #1558

Closed Duncanr-glitch closed 1 month ago

Duncanr-glitch commented 4 months ago

Fixes #1188

Copied the choices method from cpyhon's random module and then put it into a new random.py file that calls all the random.js functions renamed as _random.js.

Only works in python3

Duncanr-glitch commented 4 months ago

All of that should be done I think :) Thanks for the feedback!

bnmnetp commented 3 months ago

python3 only

meredydd commented 1 month ago

(Apologies for the long delay here!)

Yes, I am happy with a change that doesn't break existing python 2 code but does accidentally expose some python 3 features in py2 mode (this is a choice we make with the stdlib all the time, and tbh even Anvil will probably want to start deprecating our py2 support soon)