Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 698
    • Issues 698
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

In order to prepare the next update of Heptapod based on Gitlab 16.0. The instance will be unavailable on 2023-10-06 between 19:00 and 23:00 UTC+2

  • PyPyPyPy
  • pypypypy
  • Merge requests
  • !730

Implement bpo-30465: Fix lineno and col_offset in fstring AST nodes

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Yannick Jadoul requested to merge topic/py3.6/py3.6-bpo-30465 into branch/py3.6 Jun 18, 2020
  • Overview 12
  • Commits 4
  • Pipelines 6
  • Changes 4

Fixes the lineno- and col_offset-related failures on in lib-python/3/test/test_fstring.py.

See https://bugs.python.org/issue30465 and https://github.com/python/cpython/pull/1800

Also fixes the test_ast_line_numbers_multiline_fstring test to match https://github.com/python/cpython/pull/10021, since the issue solved in this CPython PR (and only available from CPython 3.8 onwards; see https://bugs.python.org/issue16806) is already handled correctly by PyPy.

I still don't fully get why in this test

    def test_ast_mutiline_lineno_and_col_offset(self):
        m = ast.parse("\n\nf'''{x}\nabc{y}\n{\nz}'''   \n\n\n")
        x_ast = m.body[0].value.values[0].value
        y_ast = m.body[0].value.values[2].value
        z_ast = m.body[0].value.values[4].value
        assert x_ast.lineno == 3
        assert x_ast.col_offset == 5
        assert y_ast.lineno == 4
        assert y_ast.col_offset == 5
        assert z_ast.lineno == 6
        assert z_ast.col_offset == 0

y_ast.col_offset is 5 and not 4, but it's consistent with CPython 3.8, so there's probably something I'm missing.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: topic/py3.6/py3.6-bpo-30465