mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[PY-27601] Updated fix for "Too few arguments for format string"
There are two important changes: Based on the implementation at https://github.com/python/cpython/blob/master/Objects/stringlib/unicode_format.h#L82 I have added two new warning messages to PyStringFormatInspection, which detect changes between manual and automatic field numbering. I have also fixed the way PySubstitutionChunkReference uses myPosition field to refer to the correct positional argument. It uses the explicitly specified position, if present, or the auto-numbered one otherwise. I have tried to fix all the visible regressions introduced by this change.
This commit is contained in:
committed by
Valentina Kiryushkina
parent
9a52af5553
commit
2a37853de1
+1
@@ -0,0 +1 @@
|
||||
<warning descr="Cannot switch from automatic field numbering to manual field specification">'{} {1}'</warning>.format(6, 7)
|
||||
+1
@@ -0,0 +1 @@
|
||||
<warning descr="Cannot switch from manual field specification to automatic field numbering">'{1} {}'</warning>.format(6, 7)
|
||||
+2
-1
@@ -1 +1,2 @@
|
||||
'{a} {}'.format(6, a=2)
|
||||
x = '{a} {}'.format(6, a=2)
|
||||
print("{} {other} {}".format("one", "two", other="OTHER"))
|
||||
|
||||
Reference in New Issue
Block a user