r/Python • • Nov 11 '19

I made c++-style printing in Python :P

Post image
1.7k Upvotes

130 comments sorted by

View all comments

Show parent comments

16

u/[deleted] Nov 11 '19

18

u/Xirious Nov 12 '19

That's like old style .format and not f-strings.

3

u/germandiago Nov 12 '19

f-strings require some kind of reflection, which C++ unfortunately does not support yet.

1

u/[deleted] Nov 12 '19 edited Nov 12 '19

I believe that some magic with macros and VARGS could do the job :P The trick is to use not used character as quotation mark.

Just like in JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals