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 cdelord
Recipients
Date 2002-06-20.22:46:55
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
It seems there's a bug in python 2.3

The following script works with python 2.2, not with 2.3

def flatten(L):
	for i in L: 
		if type(i) == list: 
			for j in flatten(i):
				yield j
		else:
			yield i 

def mklist(n):
	if n:
		return [ str(n), mklist(n-1), str(n) ] 
	else:
		return []
 
L = mklist(6) 
print "".join(flatten(L))
 
flatten seems to work but join makes a segmentation fault. 
 
It works fine with print "".join(list(flatten(L)))
or when L = mklist(4)

I'm using Python 2.3 with Linux (Redhat)

Best regards,
Christophe Delord.
History
Date User Action Args
2007-08-23 14:02:20adminlinkissue571885 messages
2007-08-23 14:02:20admincreate