Skip to content

Python 3.10/3.11 incompatible: SyntaxError: f-string expression part cannot include a backslash #751

Closed

Description

@albertz

As you see from your own CI logs here:

  File "/Users/runner/work/fastcore/fastcore/fastcore/docments.py", line 359
    sig_str = f"def {get_name(self.obj)}(\n    {'\n    '.join(lines)}\n{self._ret_str}"
                                                                                       ^
SyntaxError: f-string expression part cannot include a backslash

It seems to not work with Python 3.10 and 3.11, but fine for 3.12.

Activity

  1. albertz commented on Jan 18, 2026

    @albertz
    Author

    I'm not sure if you intended this. If yes, then your pip package is faulty, as it says it is compatible with Python 3.10/3.11, which it is not. Or if not, you should just fix the code that it still works with Python 3.10.

  2. hugetim commented on Jan 20, 2026

    @hugetim

    @jph00 This line, in version 1.12.2, is causing everyone's nbdev tests to fail for Python 3.10 and 3.11: 60544b2#diff-c7cab83f740bd9e52d01a483f5e06ecea78bdf5bf3c16bd75472bcba97c939baR359

  3. jph00 commented on Jan 20, 2026

    @jph00
    Contributor

    Sorry about that! Fixed now in v1.12.3.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions