GHPython component mysteriously changing list data from class?

What I mean is will that Python random match C#'s random, being the gh randoms are written in C#? (for the sake of gh expected results from a users point of view) As you say it is using .NET’s, so I guess it will?

I think so, but never actually tested it :thinking:

1 Like

Yes it produces consistent repeatable results on multiple runs. No it doesn’t match CPython
Quick test in GrassHopper python:

import random

random.seed(4)
for _ in range(5):
    print random.random() 

produces

0.815944526724
0.990999829951
0.563974651305
0.411932913778
0.0119761130828

The same code in CPython 3.7 or 2.7 produces

0.23604808973743452
0.1031660342307158
0.396058242610681
0.15497227080241027
0.06651509567958991

2 Likes

Scratch that, confirmed:

190411_IronPythonRandom_00.gh (2.1 KB)

2 Likes