Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 669
    • Issues 669
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Merge requests
  • !739

Merged
Created Jul 12, 2020 by Yannick Jadoul@YannickJadoulMaintainer

Fix handling of double braces in f-strings, after bpo-29104 implementation

  • Overview 3
  • Commits 1
  • Pipelines 1
  • Changes 2

Sorry it took so long, but here's the fix for what I broke in !736 (merged) (implementing https://github.com/python/cpython/pull/490).

I forgot to take the # Differs from CPython: this version handles double-braces on its own. comment into account, and the final slice instead of the StringBuilder returned double braces rather than reducing them to a single brace.

This MR should reasonably cleanly fix this.

Alternatively, it is also possible to create an implementation closer to CPython (returning a value from fstring_find_literal whether another literal part is following: cfr. https://github.com/serhiy-storchaka/cpython/blob/dbdb3a660b9374a87ac98f56578be67ff4dd1bcd/Python/ast.c#L4340-L4347)

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/py3.6/fix-fstring-double-braces