Uh oh!
There was an error while loading. Please reload this page.
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to _random.Random - #138341
Conversation
Uh oh!
There was an error while loading. Please reload this page.
serhiy-storchaka
commented
Sep 1, 2025
Wait, why is |
ZeroIntensity
commented
Sep 1, 2025
Probably because it would break code to change that. |
serhiy-storchaka
commented
Sep 1, 2025
It became mutable in 3.9. I think this is a bug. |
picnixz
commented
Sep 1, 2025
I was also surprised but I just didn't want to break stuff here. |
kumaraditya303
commented
Sep 1, 2025
Yes, I think adding IMMUTABLE flag was missed while conversion, it shouldn't be a mutable type. |
kumaraditya303
commented
Sep 1, 2025
See #88074 where most of the converted types where made immutable, same should be done for random and epoll |
Uh oh!
There was an error while loading. Please reload this page.
random.RandomPy_TPFLAGS_IMMUTABLETYPE to _random.Randompicnixz
commented
Sep 2, 2025
@rhettinger Does this change satisfy you? do you want this to be backported? |
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Sep 2, 2025
Please don't backport this change. It would be surprising that a class becomes immutable in 3.x.y bugfix release. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM, but I would prefer a single large PR that fixes the 3.9 error by making all converted types immutable.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
On main the following leaks: