You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2021-05-31.20:24:57.127>created_at=<Date2021-05-28.14:27:28.976>labels= ['extension-modules', '3.11']
title='_Random.seed() is called twice'updated_at=<Date2021-05-31.20:24:57.126>user='https://github.com/serhiy-storchaka'
_Random.seed() is called twice: first it is called in _Random.__new__(), then it is called in Random.__init__(). By default it reads system enthropy, so it consumes global system resource without need.
Consider moving seeding from _random.Random.__new__ to _random.Random.__init__. Since random.Random.__init__ doesn't call the super(), the C version never gets called, avoiding the double seeding. But, it still lets _random.Random function as a standalone class.