Files
openide/python/testData/intentions/PyConvertToFStringIntentionTest/percentOperatorFallbackResolveResultForNamedChunk.py
Mikhail Golubev 9ffbd3bd87 PY-21243 Suppress intention if chunks are resolved into RHS of % as a fallback
As a fallback value PySubstitutionChunkReference resolves into the
right operand of "%" operator whenever it cannot find individual
expressions for multiple positional formatted fields or a field with
a key. I explicitly check and suppress the intention for such cases.
In future it's better to introduce some sort of "strict resolve"
semantic in the PySubstitutionChunkReference so as do these checks
twice.
2016-11-08 18:20:22 +03:00

2 lines
109 B
Python

numbers = {'one': 'eins', 'two': 'zwei', 'three': 'drei'}
print('%(one)s %(two)s %(three)s' % nu<caret>mbers)