On Wed, 27 Sept 2023 at 16:37, Tom Tromey wrote: > > >>>>> Jonathan Wakely via Gcc-patches writes: > > Replying to a quite old email... > > I ran a Python linter on the libstdc++ pretty-printers. > > I have fixes for most of the issues that are worth fixing (I didn't > bother with line lengths -- FWIW in gdb we just run 'black' and don't > worry about these details), I used autopep8 and committed the result as e08559271b2d797f658579ac8610dbf5e58bcfd8 so the line lengths should be OK now. > but the patch I'm replying to had a problem > that I didn't know how to fix: > > > +class StdChronoTimeZoneRulePrinter: > [...] > > + if kind == 0: # DayOfMonth > > + start = '{} {}{}'.format(month, ordinal_day) > > flake8 points out that this call to format has three placeholders but > only two arguments. Oops, I think it was originally written like this: '{} {}{}'.format(month, day, suffixes.get(day, 'th')) but then I refactored it to: ordinal_day = '{}{}'.format(day, suffixes.get(day, 'th')) if kind == 0: # DayOfMonth start = '{} {}{}'.format(month, ordinal_day) So the fix is to just change the string to '{} {}' which I've pushed as 1fab05a885a308c19cf42b72fd36805ddf27fdc8 now (also attached). These printers are for implementation details internal to the library, which are never exposed to users. I added them because they made it much easier to debug the implementation when stepping through library functions, but that means there are no tests for them. Thanks for finding this!