CSSUoB / CSSUoB/TeX-Bot-Py-V2

Use new Python 3.12 f-string syntax

Abierto
#126 4 comentarios 0 reacciones 1 asignado Reclamado por @ashprit-x Ver en GitHub
good first issue
Lenguaje dominante
Python
Estrellas
1
Forks
11
Merge medio
20 h 7 min
PR fusionados (30 d)
2

Descripción

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:

```python
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:

```python
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.)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.