This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lopgok
Recipients lopgok
Date 2008-12-04.20:34:20
SpamBayes Score 9.941907e-09
Marked as misclassified No
Message-id <1228422862.72.0.643354735344.issue4534@psf.upfronthosting.co.za>
In-reply-to
Content
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 works in 3.0
    for l in lis: s = s + l
    return s

Here is my test case:
    def test_List_to_String(self):
        inp = ['f', 'r', 'e', 'd', ' ', 'i', 's']
        out = 'fred is'
        self.assertEqual(jefflib.List_to_String(inp), out)

Here is what happens when I try to run the commented out version (the
one with the join):
ERROR: test_List_to_String (__main__.TestJefflibFunctions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./jefflib_test.py", line 96, in test_List_to_String
    self.assertEqual(jefflib.List_to_String(inp), out)
  File "/cygdrive/c/documents and
settings/deifikj/jeff/scripts/jefflib.py", lin
e 256, in List_to_String
    return str.join(lis)
TypeError: descriptor 'join' requires a 'str' object but received a 'list'


Of course, it worked fine in python 2.6.
I am baffled.
History
Date User Action Args
2008-12-04 20:34:22lopgoksetrecipients: + lopgok
2008-12-04 20:34:22lopgoksetmessageid: <1228422862.72.0.643354735344.issue4534@psf.upfronthosting.co.za>
2008-12-04 20:34:22lopgoklinkissue4534 messages
2008-12-04 20:34:20lopgokcreate