Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Nov 20, 2017

  • should not be more verbose if the code is correct
  • enabled checks can be "expensive"

https://bugs.python.org/issue32043

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of which, perhaps it would be nice to set those environment variables so that child processes launched using subprocess inherit them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or perhaps let people set them themselves if they want to...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a deliberate choice to not inherit the "developer mode" to child processes. If someone would like an inherited mode, I would prefer to add a new PYTHONDEVMODE=1 environment variable, since it's more natural to inherit environment modes.

It's the same for -W ignore vs PYTHONWARNINGS=ignore.

Copy link
Member Author

@vstinner vstinner Nov 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think that PYTHONDEVMODE=1 is needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps PYTHONXOPTIONS=dev? That way it would more directly parallel the -W vs PYTHONWARNINGS arrangement.

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor suggestions inline, but generally looks good to me.

The PYTHONXOPTIONS/PYTHONDEVMODE question should be split out to a separate tracker issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable CPython's "developer mode", introducing additional runtime checks which are ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: isuse -> issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

* should not be more verbose if the code is correct
* enabled checks can be "expensive"
@vstinner
Copy link
Member Author

I created bpo-32101: Add PYTHONDEVMODE=1 to enable the developer mode.

@vstinner vstinner merged commit bc9b6e2 into python:master Nov 21, 2017
@vstinner vstinner deleted the xdev_doc branch November 21, 2017 02:59
@vstinner
Copy link
Member Author

Thank you for the review @pitrou and @ncoghlan :-) I merged my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants