About python's return value
<pre><code>    def createMenu(self, menuData):
        menu = wx.Menu()
        for eachItem in menuData:
            if len(eachItem) == 2:
                label = eachItem[0]
                subMenu = self.createMenu(eachItem[1])
                menu.AppendMenu(wx.NewId(), label, subMenu)
            else:
                self.createMenuItem(menu, *eachItem)
        return menu
</code></pre>

<p>In this code,the return value is <code>menu</code>.it refers to the Object <code>wx.Menu()</code> . This Object is a local Variable. And it will be deleted when this function call goes over.But the next code in the book is
<code>menuBar.Append(self.createMenu(menuItems), menuLabel)</code>.
<code>createMenu(menuItems)</code> How it works?I mean the object that <code>menu</code> points to has been deleted.</p>
