Deprecate and then remove the -R option

The documentation can be found here. Note that it is not documented in the --help text since randomization became default in 3.3 (c9f54cf5).

What does this option do?

Nothing [except for a special case described below]. Randomization is enabled by default since 3.3 (c9f54cf5). Currently, the option only “works” in the case when PYTHONHASHSEED is set, though this is a questionable use, as setting an option just to reset it to the default seems accidental, This is even wrongly documented (#137608).

The stated exception also did not work till 3.7 (358e5e17), so there were 4 versions where in all cases, the option was a NO-OP. Seeing as no user (Apart from Victor) noticed, it can be reasonably concluded that this option is not widely used.

I propose to deprecate the option for the standard period, and then remove it. The -J option was removed without deprecation, though I do not think the same should be done here (#133444).

4 Likes

Just to be clear: this will not imply that PYTHONHASHSEED stops working, right ?!

Being able to fix the hash seed is important for having deterministic and reproducible tests (and probably builds as well, since PYC files are affected by the string hash randomization as well, AFAIR).

Nothing should change there, this proposal is strictly about removing the command line option -R.

Great. Thanks for clarifying.

1 Like