String formatting style

Johannes Schönberger jsch at demuc.de
Tue Sep 2 23:01:56 EDT 2014


I am actually happy with the new way (although, I am still using the old % operator mostly…).

Johannes Schönberger

On Sep 2, 2014, at 8:20 PM, Michael Aye <kmichael.aye at gmail.com> wrote:

> It's part of the Python tutorial for many years and common standard I'd say.
> It's basic use might be cumbersome at first, but its power is great.
> 
> Things like "My name is {0[name]}".format(dict(name='Fred'))
> or
> "My name is {0.name}".format(open('out.txt', 'w'))
> lets you template-control strings in very elaborate manners.
> The most minimalistic way btw is:
> 
> "My first name is {} and my last name is {}".format(firstname, lastname)
> 
> Michael
> 
> On Tuesday, September 2, 2014 7:36:44 AM UTC-7, Juan Nunez-Iglesias wrote:
> I'm not convinced either, but it seems to be what the whole community is moving to (I saw many instances of it at PyCon-AU), so we might as well get with the program!
> 
> On Tuesday, September 2, 2014, Stéfan van der Walt <ste... at sun.ac.za> wrote:
> Hi all
> 
> What are your opinions on
> 
> http://legacy.python.org/dev/peps/pep-3101/
> 
> I see this is used in some PRs, and I'm not convinced of its readability.
> 
> Stéfan
> 
> --
> You received this message because you are subscribed to the Google Groups "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.




More information about the scikit-image mailing list