recursion problem

Fredrik Lundh fredrik at pythonware.com
Mon Sep 17 13:18:19 EDT 2001


Uwe Schmitt wrote:

> Where does the "None" in the last line come from ? I don't understand
> this behaviour of my routine. Each return-statement in my script returns
> a list...

nope.

>      return retval.append(p0)

append doesn't do what you think it does:

>>> L = [1, 2, 3]
>>> print L
[1, 2, 3]
>>> print L.append(4)
None

(before posting "why doesn't append" etc, check the FAQ)

> Is this a python bug?

given that Python's been out there for over ten years, don't you
think we would have noticed by now? ;-)

</F>





More information about the Python-list mailing list