Message312156
Aye, definitely worth a thread on python-ideas. My rationale for suggesting something based on the built-in numeric codes is that it makes it straightforward for *users* to transfer knowledge from that mini-language.
As far as parsing goes, I was thinking of something along the lines of the following naive approach:
typechar = fmt[-1:]
if not typechar or typechar not in ("b", "n", "x"):
return super().__format__(fmt)
prefix, group_sep, suffix = fmt[:-1].rpartition("_")
if prefix and prefix != "#" or suffix:
return super().__format__(fmt)
field_width = self._calculate_field_width(typechar)
return format(int(self), f"{prefix}0{field_width}{group_sep}{type_char}") |
|
Date |
User |
Action |
Args |
2018-02-14 04:56:02 | ncoghlan | set | recipients:
+ ncoghlan, eric.smith, christian.heimes, serhiy.storchaka, ewosborne |
2018-02-14 04:56:02 | ncoghlan | set | messageid: <1518584162.51.0.467229070634.issue32820@psf.upfronthosting.co.za> |
2018-02-14 04:56:02 | ncoghlan | link | issue32820 messages |
2018-02-14 04:56:02 | ncoghlan | create | |
|