Jul-25-2019, 05:29 AM
the language reference section describing Formatted string literals says: "The result is then formatted using the format() protocol. The format specifier is passed to the __format__() method of the expression or conversion result." it is very unclear what is going on here. it seems like it is saying that it is formated twice (passing the result on to be formatted again). but the 2nd formatting makes no sense, if the result (presumably a string) is passed to __format__(). what normally happens there?
the examples look simple and make sense. but not understanding the described steps means i'm not going to know the subtle behavior with something strange, or weird bugs.
an online article says: "The expressions are evaluated at runtime and then formatted using the __format__ protocol. As always, the Python docs are your friend when you want to learn more." it has nice looking examples that don't give a solid understanding. it can't be my friend until i understand it.
i've already seen some heavy-duty use of f-strings that just didn't make sense, to me. at least, it didn't, yet. this is why i want a solid understanding of what is going on. there seems to be a more advanced level of understanding needed to be able to interpret all kings of f-string.
does anyone understand what i am not understanding? i know enough to make some working f-strings. but it seems my understanding has some serious gaps.
the examples look simple and make sense. but not understanding the described steps means i'm not going to know the subtle behavior with something strange, or weird bugs.
an online article says: "The expressions are evaluated at runtime and then formatted using the __format__ protocol. As always, the Python docs are your friend when you want to learn more." it has nice looking examples that don't give a solid understanding. it can't be my friend until i understand it.
i've already seen some heavy-duty use of f-strings that just didn't make sense, to me. at least, it didn't, yet. this is why i want a solid understanding of what is going on. there seems to be a more advanced level of understanding needed to be able to interpret all kings of f-string.
does anyone understand what i am not understanding? i know enough to make some working f-strings. but it seems my understanding has some serious gaps.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.