Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Use new Python 3.12 f-string syntax

未关闭
#126 4 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 4 天内回复

@ashprit-x 已经在做这个了。

开始于 2024年7月5日。

评估

这个 Issue 还没有评估数据。

描述

good first issue

Now that we have updated this project to use Python 3.12 (#124), all multi-line f-strings should be updated to use the new syntax.

For example:

my_var: str = (
    f"""This is a {
        random.choice("good", "amazing", "wonderful")
    }. My next random number will be provided below in due course: {
        random.choice(
            999_999_999_999_999,
            420,
            10,
            0
        )
        if random.randint(0, 101) == 69
        else random.random()
    }"""
)

Would be changed to:

my_var: str = (
    f"This is a {random.choice("good", "amazing", "wonderful")}. "
    "My next random number will be provided below in due course: "
    f"{
        random.choice(
            999_999_999_999_999,
            420,
            10,
            0
        )
        if random.randint(0, 101) == 69
        else random.random()
    }"
)

(I am aware that this example can be simplified on to a single line without the line-length being exceeded, however this is just an example. Use the shown changes to help when the changed lines do exceed the maximum allowed line-length.)

主要语言
Python
星标
1
派生
11
平均合并
7 天 19 小时
30 天内合并 PR
6

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CSSUoB/TeX-Bot-Py-V2 的其他 Issue

查看 CSSUoB/TeX-Bot-Py-V2 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。