Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
English Grammar
#2
I like the idea, but wouldn't it be a little lighter if instead of a Text class, you defined a special type of formatting strings, say fmtstr, so that you could write
s = fmtstr('{} had {:w}. The {:o} knight to enter the castle had {:w}').format(
              ['Arthur', 'Lancelot', 'Robin'], (2, 'monkey'), 1, (3, 'dog'))
The fmstr.format() method would select its behavior depending the types of its arguments: list, tuples, numbers etc.
Reply


Messages In This Thread
English Grammar - by ichabod801 - Jan-05-2020, 04:14 AM
RE: English Grammar - by Gribouillis - Jan-05-2020, 08:32 AM
RE: English Grammar - by ichabod801 - Jan-05-2020, 03:39 PM
RE: English Grammar - by Larz60+ - Jan-05-2020, 09:41 AM

Forum Jump:

User Panel Messages

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