On 28/08/2014 13:08, Roy Smith wrote:
In article <63bdccb4-9e34-4e40-b07d-14342e218...@googlegroups.com>,
peter wrote:
I used to struggle with the concept of ''.join(('hello ','world')) - it
seemed so convoluted compared with the intuitive 'hello '+'world', and I
could never remember the syn
On 08/28/2014 03:08 PM, Roy Smith wrote:
For places where performance doesn't matter, string addition is just
fine. The computer works for you. If you're working for the computer,
you're doing something wrong.
I like this :-)
--
https://mail.python.org/mailman/listinfo/python-list
In article <63bdccb4-9e34-4e40-b07d-14342e218...@googlegroups.com>,
peter wrote:
> I used to struggle with the concept of ''.join(('hello ','world')) - it
> seemed so convoluted compared with the intuitive 'hello '+'world', and I
> could never remember the syntax. Also, for the strings I was
On Thu, Aug 28, 2014 at 6:43 PM, Mark Lawrence wrote:
> On 28/08/2014 09:30, peter wrote:
>>
>> I used to struggle with the concept of ''.join(('hello ','world')) - it
>> seemed so convoluted compared with the intuitive 'hello '+'world', and I
>> could never remember the syntax. Also, for the str
On 28/08/2014 09:30, peter wrote:
I used to struggle with the concept of ''.join(('hello ','world')) - it seemed
so convoluted compared with the intuitive 'hello '+'world', and I could never
remember the syntax. Also, for the strings I was generally using the
performance penalty was infinites
I used to struggle with the concept of ''.join(('hello ','world')) - it seemed
so convoluted compared with the intuitive 'hello '+'world', and I could never
remember the syntax. Also, for the strings I was generally using the
performance penalty was infinitesimal, so I was just adding complexit
peter :
> Obviously this isn't going to change, but for concatenating short
> strings a and b is there any practical reason to avoid a+b?
Often, no. The biggest penalty is visual. For example, I would prefer
this:
"{}/{}".format(prefix, suffix)
over
prefix + "/" + suffix
Really, I wo
On 2014-08-27 23:59, Peter Otten wrote:
Tim Chase wrote:
On 2014-08-27 23:42, MRAB wrote:
How many parameters are there? len(self.param)
Make that many placeholders and then join them together with
commas:
', '.join(['?'] * len(self.param))
I prefer the clarity of Peter Otten's suggestion
Tim Chase wrote:
> On 2014-08-27 23:42, MRAB wrote:
>> How many parameters are there? len(self.param)
>>
>> Make that many placeholders and then join them together with commas:
>>
>> ', '.join(['?'] * len(self.param))
>
> I prefer the clarity of Peter Otten's suggestion of
>
> ', '.join('?'
On Thu, Aug 28, 2014 at 8:44 AM, Tim Chase
wrote:
> On 2014-08-27 23:42, MRAB wrote:
>> How many parameters are there? len(self.param)
>>
>> Make that many placeholders and then join them together with commas:
>>
>> ', '.join(['?'] * len(self.param))
>
> I prefer the clarity of Peter Otten's sugge
On 2014-08-27 23:42, MRAB wrote:
> How many parameters are there? len(self.param)
>
> Make that many placeholders and then join them together with commas:
>
> ', '.join(['?'] * len(self.param))
I prefer the clarity of Peter Otten's suggestion of
', '.join('?' * len(self.param))
over the mild
On 2014-08-27 21:31, dennisearlev...@gmail.com wrote:
Hi,
Sorry about the simple question but I am very new to Python.
Anyway, I have a function that will be used to call a stored procedure and I
need to format the string with the correct number of parameter markers for the
ODBC dri
dennisearlev...@gmail.com wrote:
>
> Hi,
>
> Sorry about the simple question but I am very new to Python.
>
> Anyway, I have a function that will be used to call a stored procedure
> and I need to format the string with the correct number of parameter
> markers for the ODBC driver, fa
On Wed, Aug 27, 2014 at 1:31 PM, wrote:
>
> Hi,
>
> Sorry about the simple question but I am very new to Python.
>
> Anyway, I have a function that will be used to call a stored procedure and
> I need to format the string with the correct number of parameter markers for
> the ODBC driver,
Hi,
Sorry about the simple question but I am very new to Python.
Anyway, I have a function that will be used to call a stored procedure and I
need to format the string with the correct number of parameter markers for the
ODBC driver, fairly standard stuff.
What I have works but lo
15 matches
Mail list logo