As you’ve all probably seen, the Python 3.8 DeprecationWarning has been elevated for a number of various bits and I’m seeing a lot of them that may indicate missing pieces in the wrappers.
Here’s one:
item = wx.MenuItem(menu, id, text, kind=wx.ITEM_NORMAL)
If id
is an int or wx._core.StandardID
everyone is happy, but if it’s a wx._core.WindowIDRef
, then I see
DeprecationWarning: an integer is required (got type WindowIDRef). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
Another example here:
wx\core.py:1477: DeprecationWarning: an integer is required (got type WindowIDRef). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
Where the (trimmed down) code from core.py looks like this, line 1477 is the call to Connect
:
class PyEventBinder(object):
def Bind(self, target, id1, id2, function):
for et in self.evtType:
target.Connect(id1, id2, et, function)
Is there a way to define the WindowIDRef
class such that it casts itself to an int like StandardID
apparently does so as to fix these warnings?