Python Forum
trying to learn f-strings - puzzled by format() protocol
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trying to learn f-strings - puzzled by format() protocol
#6
in the documentation i see it say "An empty string is passed when the format specifier is omitted." is "format specifier" the "format_spec" that follows ":" (as in the next paragraph)? i don't see any format_specs in DeaD_EyE's code. but his print does not show arguments so i can't tell if __format__ was really called with an empty string.

in the syntax chart, the 2nd to last line has "format_spec ::= (literal_char| NULL |replacement_field)*". what does the * mean? that it can be repeated 0 or more times as in regular expressions?

this is in the PDF language reference for 3.7.4 (though i am running 3.6.8).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: trying to learn f-strings - puzzled by format() protocol - by Skaperen - Jul-26-2019, 01:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  print a list strings is fast but printing the joined strings is slow Skaperen 9 3,966 Aug-26-2019, 07:48 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020