[issue33160] Negative values in positional access inside formatting

2018-03-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Should str.format allow negative indexes when used for __getitem__ access? ___ Python tracker

[issue33160] Negative values in positional access inside formatting

2018-03-27 Thread Ned Deily
Change by Ned Deily : -- nosy: +eric.smith type: -> enhancement versions: +Python 3.8 -Python 3.6 ___ Python tracker ___

[issue33160] Negative values in positional access inside formatting

2018-03-27 Thread Facundo Batista
New submission from Facundo Batista : This works fine: >>> "{[0]}".format([1, 2, 3]) '1' This should work too: >>> "{[-1]}".format([1, 2, 3]) Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers or slices, not str