Skip to content

use f string - #159

Merged
Christian-B merged 1 commit into
masterfrom
use_f_string
Sep 3, 2026
Merged

Christian-B merged 1 commit into
masterfrom
use_f_string

Conversation

@Christian-B

Copy link
Copy Markdown
Member

part of SpiNNakerManchester/SupportScripts#100

see https://docs.astral.sh/ruff/rules/printf-string-formatting/

testing shows that

  • f"{an_int}" works the same as "%d" % an_int

    • And the fsrting is better if an_int is actually a float
  • f"{a_float} works the same as "%g" % a_float

-a string can be both an f and an r string

  • leaving the variable a t would work but I changed it to ms to avoid confusion.

@Christian-B
Christian-B merged commit d8afe51 into master Sep 3, 2026
11 checks passed
@Christian-B
Christian-B deleted the use_f_string branch September 3, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant