Consider the following code:
s = 'ab{}cd{mykey}ef{}gh'.format('01', '23', mykey='45')
print(s)
There are 3 placeholders: two positional and one keyword. I've provided enough arguments and the script runs normally, producing the following output:
ab01cd45ef23gh
But PyCharm warns me the following:
My questions are:
I'm using PyCharm Community 2018.1 EAP and Python 3.7.5
Update your PyCharm (2020.1.3 is the latest at the moment). This is an IDE bug, and it was already fixed since 2018.