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
#7
The format specs are defined in the types str, int, float, datetime (or somewhere else), etc..
If you do your own format, you must write a parser for it.
The data is processed in the __format__ method and the __format__ method must return always a string.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: trying to learn f-strings - puzzled by format() protocol - by DeaD_EyE - Jul-26-2019, 09:13 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,962 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