[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 rep...@bugs.python.org
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 call methods is to use them on objects:

someString = 
someList = ['f', 'r', 'e', 'd', ' ', 'i', 's']
someString.join(someList)

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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]
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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]
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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]
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.  The separator between elements is S.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4534
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com