Skip to content

Add a new -X dev option: "developer mode" #76224

Closed

Description

@vstinner
BPO 32043
Nosy @warsaw, @vstinner
PRs
  • bpo-32043: New "developer mode": "-X dev" option #4413
  • bpo-32043: Rephrase -X dev documentation #4478
  • 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

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-11-21.03:03:29.377>
    created_at = <Date 2017-11-16.02:43:27.272>
    labels = ['interpreter-core', 'type-feature', '3.7']
    title = 'Add a new -X dev option: "developer mode"'
    updated_at = <Date 2017-11-21.03:03:29.376>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-11-21.03:03:29.376>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-21.03:03:29.377>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2017-11-16.02:43:27.272>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32043
    keywords = ['patch']
    message_count = 7.0
    messages = ['306330', '306331', '306351', '306357', '306619', '306620', '306621']
    nosy_count = 2.0
    nosy_names = ['barry', 'vstinner']
    pr_nums = ['4413', '4478']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32043'
    versions = ['Python 3.7']

    Activity

    1. vstinner commented on Nov 16, 2017

      @vstinner
      MemberAuthor

      I propose to add a new "developer mode": a new "-X dev" command line option.

      In short:
      python3 -X dev script.py
      behaves as:
      PYTHONMALLOC=debug python3 -W default -X faulthandler script.py

      For the rationale, please see:
      https://mail.python.org/pipermail/python-dev/2017-November/150514.html

    2. vstinner commented on Nov 16, 2017

      @vstinner
      MemberAuthor

      I rewrote Py_Main() in bpo-32030 to make it very easy to implement this new feature.

      I wrote PR 4413 to implement -X dev.

    3. vstinner commented on Nov 16, 2017

      @vstinner
      MemberAuthor

      New changeset ccb0442 by Victor Stinner in branch 'master':
      bpo-32043: New "developer mode": "-X dev" option (bpo-4413)
      ccb0442

    4. vstinner commented on Nov 16, 2017

      @vstinner
      MemberAuthor

      Antoine Pitrou asked me to document the performance and memory overhead of -X dev:

      https://mail.python.org/pipermail/python-dev/2017-November/150578.html

      For example, I measured an increase of +50% on the peak memory usage (measured by tracemalloc) when running test_os.

      Antoine proposed:

      """Currently, developer mode adds negligible CPU time overhead, but can
      increase memory consumption significantly if many small objects are
      allocated. This is subject to change in the future."""

      https://mail.python.org/pipermail/python-dev/2017-November/150579.html

    5. vstinner commented on Nov 21, 2017

      @vstinner
      MemberAuthor

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

    6. vstinner commented on Nov 21, 2017

      @vstinner
      MemberAuthor

      New changeset bc9b6e2 by Victor Stinner in branch 'master':
      bpo-32043: Rephrase -X dev documentation (bpo-4478)
      bc9b6e2

    7. vstinner commented on Nov 21, 2017

      @vstinner
      MemberAuthor

      While the discussion is not done, I close this issue to focus on other more specific issues.

      I completed the documentation and fixed warnings filters (bpo-32089). The option now also enables asyncio debug mode (bpo-32047).

      It was proposed to add an environment variable to enable the developer mode: see bpo-32101 ("Add PYTHONDEVMODE=1 to enable the developer mode").

      Note: I also fixed subprocess._args_from_interpreter_flags: bpo-32094.

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions