New submission from Mykyta <poberezhn...@icloud.com>:
The formatting does not work correctly. I have a dict with string representations of integers as keys, such as {'1': 'a'} and trying to format it this way: '{0[1]}' and KeyError occurs. But I think it should not as '{0[a]}'.format(a) works properly with a = {'a': '1'} and '{0[1]}'.format(a) works properly with a = {1: 'a'}. Adding quotation marks does not help, KeyError occurs with '"1"'. ---------- components: Unicode files: 1.png messages: 397867 nosy: NickP, ezio.melotti, vstinner priority: normal severity: normal status: open title: String formatting type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50166/1.png _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44683> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com