Re: Using + with strings considered bad

2015-04-29 Thread Andrew Berg
On 2015.04.29 04:08, Mark Lawrence wrote: > On 29/04/2015 09:29, Cecil Westerhof wrote: >> Because I try to keep my lines (well) below 80 characters, I use the >> following: >> print('Calculating fibonacci and fibonacci_memoize once for ' + >>str(large_fibonacci) + ' to determine s

Re: Using + with strings considered bad

2015-04-29 Thread Steven D'Aprano
On Wed, 29 Apr 2015 06:29 pm, Cecil Westerhof wrote: > Because I try to keep my lines (well) below 80 characters, I use the > following: > print('Calculating fibonacci and fibonacci_memoize once for ' + > str(large_fibonacci) + ' to determine speed increase') That's perfectly fine,

Re: Using + with strings considered bad

2015-04-29 Thread Chris Angelico
On Wed, Apr 29, 2015 at 10:23 PM, Cecil Westerhof wrote: > In 2.7 that gives: >('Calculating fibonacci and fibonacci_memoize once for', 40, 'to determine > speed increase') > > So I am going to use the one above it. Start your script with: from __future__ import print_function Problem solv

Re: Using + with strings considered bad

2015-04-29 Thread Cecil Westerhof
Op Wednesday 29 Apr 2015 11:24 CEST schreef Peter Otten: >> print('Calculating fibonacci and fibonacci_memoize once for ' + >> str(large_fibonacci) + ' to determine speed increase') > > You could write that as > > print('Calculating fibonacci and fibonacci_memoize once for ' > '{} to determine spe

Re: Using + with strings considered bad

2015-04-29 Thread Cecil Westerhof
Op Wednesday 29 Apr 2015 11:24 CEST schreef Peter Otten: > Cecil Westerhof wrote: > >> Because I try to keep my lines (well) below 80 characters, I use >> the following: print('Calculating fibonacci and fibonacci_memoize >> once for ' + str(large_fibonacci) + ' to determine speed increase') >> >>

Re: Using + with strings considered bad

2015-04-29 Thread Peter Otten
Cecil Westerhof wrote: > Because I try to keep my lines (well) below 80 characters, I use the > following: > print('Calculating fibonacci and fibonacci_memoize once for ' + > str(large_fibonacci) + ' to determine speed increase') > > But I was told that using + with strings was bad

Re: Using + with strings considered bad

2015-04-29 Thread Mark Lawrence
On 29/04/2015 09:29, Cecil Westerhof wrote: Because I try to keep my lines (well) below 80 characters, I use the following: print('Calculating fibonacci and fibonacci_memoize once for ' + str(large_fibonacci) + ' to determine speed increase') But I was told that using + with stri