Skip to content

Python 3.8b1 miscompiles conditional expressions containing __debug__ #81450

Closed

Description

@mgedmin
mannequin
BPO 37269
Nosy @mgedmin, @pablogsal, @miss-islington
PRs
  • bpo-37269: Correctly optimize constant conditionals of binops #14071
  • [3.8] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) #14072
  • [3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) #14073
  • 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 2019-06-14.06:19:13.942>
    created_at = <Date 2019-06-13.18:56:04.786>
    labels = ['interpreter-core', '3.8', '3.9']
    title = 'Python 3.8b1 miscompiles conditional expressions containing __debug__'
    updated_at = <Date 2019-06-14.06:19:13.941>
    user = 'https://github.com/mgedmin'

    bugs.python.org fields:

    activity = <Date 2019-06-14.06:19:13.941>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-14.06:19:13.942>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2019-06-13.18:56:04.786>
    creator = 'mgedmin'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37269
    keywords = ['patch']
    message_count = 5.0
    messages = ['345533', '345552', '345554', '345555', '345556']
    nosy_count = 3.0
    nosy_names = ['mgedmin', 'pablogsal', 'miss-islington']
    pr_nums = ['14071', '14072', '14073']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37269'
    versions = ['Python 3.8', 'Python 3.9']

    Activity

    1. mgedmin commented on Jun 13, 2019

      mgedminmannequin
      MannequinAuthor

      Python 3.8 miscompiles the following code:

          $ cat /tmp/wat.py
          enable_debug = False
          if not enable_debug or not __debug__:
              print("you shall not pass!")
          $ python3.7 /tmp/wat.py
          you shall not pass!
      
          $ python3.8 /tmp/wat.py

      (no output is produced.)

      This is a distilled example from zope.traversing's codebase (zopefoundation/zope.traversing#13).

    2. pablogsal commented on Jun 14, 2019

      @pablogsal
      Member

      New changeset 05f8318 by Pablo Galindo in branch 'master':
      bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
      05f8318

    3. miss-islington commented on Jun 14, 2019

      @miss-islington
      Contributor

      New changeset 7cd581a by Miss Islington (bot) in branch '3.8':
      bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
      7cd581a

    4. pablogsal commented on Jun 14, 2019

      @pablogsal
      Member

      New changeset 5292179 by Pablo Galindo in branch '3.7':
      [3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) (GH-14073)
      5292179

    5. pablogsal commented on Jun 14, 2019

      @pablogsal
      Member

      Thanks, Marius for the report!

    6. 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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions