isinstance wx.Choice and wx.ComboBox

Robin Dunn wrote:

Stano Paska wrote:

I have interesting problem.
In wxpython 2.4.2.4 it was ok.
In wxpython 2.6.1.0 (WinXP, python 2.4) it does not work:

import wx
aaa = wx.ComboBox(None, 1000)
isinstance(aaa, wx.ComboBox)
>>> True
isinstance(aaa, wx.Choice)
>>> True, expected False

In my application I have control and I must find which instance it is...
Is this bug, or I must use another (what?) method?

wx.ComboBox derives from wx.Choice in wxMSW, but from wx.Control and wx.ItemContainer on the other platforms.

You could test for wx.ComboBox first and then skip the wx.Choice condition branch if it's a combo...

Thank you, after small correction it's work.

They can wrote a note in the manual...

Stano.