Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Gary Herron
On 12/02/2015 10:55 PM, Robert wrote: Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link: https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls I have a problem on running the last line:

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Sijan Bhandari
On Thursday, December 3, 2015 at 12:40:52 PM UTC+5:45, Robert wrote: > Hi, > > I read the tutorial on "Why is join() a string method instead of a list > or tuple method?" > at link: > https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls > >

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Robin Koch
Am 03.12.2015 um 17:25 schrieb Ian Kelly: On Thu, Dec 3, 2015 at 9:00 AM, Robin Koch wrote: Now *I* am confused. Shouldn't it be ", ".join(['1', '2', '4', '8', '16']) instead? Without any importing? That would be the normal way to write it. The FAQ entry is

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Terry Reedy
On 12/3/2015 11:00 AM, Robin Koch wrote: Am 03.12.2015 um 10:02 schrieb Gary Herron: On 12/02/2015 10:55 PM, Robert wrote: Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link:

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread MRAB
On 2015-12-03 16:00, Robin Koch wrote: Am 03.12.2015 um 10:02 schrieb Gary Herron: On 12/02/2015 10:55 PM, Robert wrote: Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link:

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Ian Kelly
On Thu, Dec 3, 2015 at 9:00 AM, Robin Koch wrote: > Now *I* am confused. > > Shouldn't it be > > ", ".join(['1', '2', '4', '8', '16']) > > instead? Without any importing? That would be the normal way to write it. The FAQ entry is suggesting the string module function as

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Robin Koch
Am 03.12.2015 um 10:02 schrieb Gary Herron: On 12/02/2015 10:55 PM, Robert wrote: Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link: https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Mark Lawrence
On 03/12/2015 17:01, Robin Koch wrote: Am 03.12.2015 um 17:25 schrieb Ian Kelly: On Thu, Dec 3, 2015 at 9:00 AM, Robin Koch wrote: Now *I* am confused. Shouldn't it be ", ".join(['1', '2', '4', '8', '16']) instead? Without any importing? That would be the normal

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Robin Koch
Am 03.12.2015 um 18:23 schrieb Terry Reedy: On 12/3/2015 11:00 AM, Robin Koch wrote: Am 03.12.2015 um 10:02 schrieb Gary Herron: On 12/02/2015 10:55 PM, Robert wrote: Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link:

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Robin Koch
Am 03.12.2015 um 18:42 schrieb Mark Lawrence: On 03/12/2015 17:01, Robin Koch wrote: Am 03.12.2015 um 17:25 schrieb Ian Kelly: On Thu, Dec 3, 2015 at 9:00 AM, Robin Koch wrote: Now *I* am confused. Shouldn't it be ", ".join(['1', '2', '4', '8', '16']) instead?

'string.join' is wrong in my Python console

2015-12-02 Thread Robert
Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link: https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls I have a problem on running the last line: --- If none of these arguments

Re: 'string.join' is wrong in my Python console

2015-12-02 Thread dieter
Robert writes: > I read the tutorial on "Why is join() a string method instead of a list > or tuple method?" > at link: > https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls > > I have a problem on running the last line: