wx.Size
wx.Size objects in wxPython can sometimes be equated to tuples, but, to deal with the cases and versions where it cannot, it is better not to rely on this.
This means that in function calls that take wx.Size, you should create a wxSize to pass them and not shortcut with a tuple.
- This is not true. Anywhere that a wx.Size is expected by the C++ fucntions a tuple can safely be used and the wrappers will automatically convert from a 2-tuple of numbers. The only place it can be an issue is when calling Python functions that take a size and they expect to be able to use the attributes of the wx.Size class. But that can be easily worked around in the called function itself by having it ensure that it is actually receiving a wx.Size, like this: This example converts the size parameter to a local variable named size that is a wx.Size object, using tuple expansion to pass the parameters to the constructor of the new object. If the parameter is a 2-tuple (or other sequence of 2 numbers) then it works as expected. If it was a wx.Size already then it still works because wx.Size supports being accessed as a Python sequence.
This is similar also to wx.Point.
Example
To create a wx.Size object -
1 size = wx.Size(width, height)