Handle 3.6 Format String conversions !r, !s, !a

This commit is contained in:
rocky
2016-08-25 07:26:01 -04:00
parent a67891c563
commit 1087613a27
3 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@@ -1,3 +1,3 @@
var1 = 'x'
var2 = 'y'
print(f'interpolate {var1} strings {var2} py36')
print(f'interpolate {var1} strings {var2!r} {var2!s} py36')

View File

@@ -591,7 +591,8 @@ class SourceWalker(GenericASTTraversal, object):
# Python 3.6+ Additions
#######################
TABLE_DIRECT.update({
'formatted_value': ( '{%c}', 0),
'formatted_value': ( '{%c%c}', 0, 1),
'FORMAT_VALUE': ( '%{pattr}', ),
'joined_str': ( "f'%c'", 2),
})
return