This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author avdwoude
Recipients avdwoude
Date 2021-06-23.07:26:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624433164.24.0.876705812645.issue44496@roundup.psfhosted.org>
In-reply-to
Content
I expected the custom Formatter to behave the same as the normal "".format() function, but unnamed args or not supported.
Below is an example, which fails at a KeyError.


from string import Formatter

class test():
    def __init__(self):
        self.msg = "OK"
t = test()

print("Normal format() is {.msg}".format(t))

f = Formatter()
print(f.format("Formatter.format() is {.msg}", t))
History
Date User Action Args
2021-06-23 07:26:04avdwoudesetrecipients: + avdwoude
2021-06-23 07:26:04avdwoudesetmessageid: <1624433164.24.0.876705812645.issue44496@roundup.psfhosted.org>
2021-06-23 07:26:04avdwoudelinkissue44496 messages
2021-06-23 07:26:04avdwoudecreate