diff --git a/docs/cli.rst b/docs/cli.rst index 3a6b9d4c6..15aee5e98 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -23,7 +23,7 @@ might look like this:: verbose = cli.Flag(["v", "verbose"], help = "If given, I will be very talkative") def main(self, filename): - print("I will now read {0}".format(filename)) + print(f"I will now read {filename}") if self.verbose: print("Yadda " * 200) @@ -492,7 +492,7 @@ attached to the root application using the ``subcommand`` decorator :: def main(self, *args): if args: - print("Unknown command {0!r}".format(args[0])) + print(f"Unknown command {args[0]}") return 1 # error exit code if not self.nested_command: # will be ``None`` if no sub-command follows print("No command given") diff --git a/docs/colorlib.rst b/docs/colorlib.rst index e880b4ba3..46bbb905d 100644 --- a/docs/colorlib.rst +++ b/docs/colorlib.rst @@ -246,9 +246,9 @@ For example, if you wanted to create an HTMLStyle and HTMLcolors, you could do:: result = '' if self.bg and not self.bg.reset: - result += ''.format(self.bg.hex_code) + result += f'' if self.fg and not self.fg.reset: - result += ''.format(self.fg.hex_code) + result += f'' for attr in sorted(self.attributes): if self.attributes[attr]: result += '<' + self.attribute_names[attr] + '>'