This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bukzor
Recipients bukzor, docs@python, terry.reedy
Date 2010-09-21.00:07:22
SpamBayes Score 1.12022e-13
Marked as misclassified No
Message-id <>
If I understand this code, it means that PYTHONOPTIMIZE set to 1 or 2 works as expected, but set to 0, gives a flag value of 1.

static int
add_flag(int flag, const char *envs)
        int env = atoi(envs);
        if (flag < env)
                flag = env;
        if (flag < 1)
                flag = 1;
        return flag;

Read literally, the man page indicates that any integer value will give a flag value of 2. 

I agree my shell script is probably unusual, but I believe setting this environment value to zero and expecting the feature to be off (given no contradicting options) is reasonable.

I petition to remove the second if statement above (environment value of "0" yields no flag).

I'd also love to provide a numeric argument to -O, to dynamically set this value more readily, but that is lower importance.

I can implement these and run the unit tests if required.
Date User Action Args
2010-09-21 00:07:23bukzorsetrecipients: + bukzor, terry.reedy, docs@python
2010-09-21 00:07:23bukzorsetmessageid: <>
2010-09-21 00:07:22bukzorlinkissue9583 messages
2010-09-21 00:07:22bukzorcreate