[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2013-07-13 Thread arsalan
arsalan added the comment: it is really a good help -- nosy: +bkyasi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-05 Thread jeff deifik
jeff deifik <[EMAIL PROTECTED]> added the comment: I fixed the code as follows: return str.join('',lis) I think it is readable, and I understand it. Thanks everyone for clarifying everything ___ Python tracker <[EMAIL PROTECTED]>

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: "str" is not your string, it's not a string; "str" is a class name, a standard type. "str.join" is a unbound method. You can call it directly if you pass an actual string object in front of the other arguments. But the normal way to cal

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-04 Thread jeff deifik
jeff deifik <[EMAIL PROTECTED]> added the comment: Yes, it was import string string.join(lis, '') I am still a bit confused though. Why doesn't my code of str.join(lis, '') work? I don't think str is a reserved word. I suppose that python might be able to deduce that str is of type string, ba

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: >>> str.join(lis, '') I doubt this really worked with 2.6. Wasn't it something like: >>> import string >>> string.join(lis, '') -- nosy: +amaury.forgeotdarc resolution: -> invalid status: open -> closed _

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-04 Thread David W. Lambert
David W. Lambert <[EMAIL PROTECTED]> added the comment: I did this to find out what are str.join's arguments--- $ python3 -c 'help(str.join)' Help on method_descriptor: join(...) S.join(sequence) -> str Return a string which is the concatenation of the strings in the sequence.

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-04 Thread jeff deifik
jeff deifik <[EMAIL PROTECTED]> added the comment: Thanks. I want to learn what is wrong with the code I have though. My main goal is to understand python 3.0 better, rather than fixing a specific problem. ___ Python tracker <[EMAIL PROTECTED]>

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-04 Thread David W. Lambert
David W. Lambert <[EMAIL PROTECTED]> added the comment: Try this--- def List_to_String(lis,separator=''): return separator.join(lis) -- nosy: +LambertDW ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4534] problem with str.join - should work with list input, error says requires 'str' object

2008-12-04 Thread jeff deifik
Changes by jeff deifik <[EMAIL PROTECTED]>: -- title: problem with str.join -> problem with str.join - should work with list input, error says requires 'str' object ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4534] problem with str.join

2008-12-04 Thread jeff deifik
New submission from jeff deifik <[EMAIL PROTECTED]>: I compiled python 3.0 on a cygwin platform. Here is my modest function: def List_to_String(lis): #return str.join(lis, '') # This is fast, but seems broke in 3.0 s = '' # This is really slow, but