Bug in Python 2.3 ?

Christophe Delord christophe.delord at free.fr
Thu Jun 20 14:53:35 EDT 2002

It seems there's a bug in python 2.3 (available on CVS).

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
			yield i 

def mklist(n):
	if n:
		return [ str(n), mklist(n-1), str(n) ] 
		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)))

I'm using Python 2.3 with Linux (Redhat)


(o_   Christophe Delord                   _o)
//\   http://christophe.delord.free.fr/   /\\
V_/_  mailto:christophe.delord at free.fr   _\_V

More information about the Python-list mailing list