<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
While updating to PyQt5 (and python3) I am experiencing an issue
with overloaded methods where one overload takes a list of items and
another overload takes a list of a list of items.<br>
<br>
When called with a list of a list of items, a TypeError is produced
warning that "index 0 has type 'list' but 'item' is expected.<br>
<br>
It seems that the first overload for a "list of something" is found
and when "something" doesn't match, no different list overloads are
tried which might still be of type "list of something else".<br>
<br>
This works fine with PyQt4. Does this ring a bell for someone?<br>
<br>
Here a short (handwritten) example of the situation.<br>
<br>
Regards<br>
Matthias<br>
<br>
<br>
----------------------------------<br>
<br>
class Point<br>
{<br>
double x;<br>
double y;<br>
};<br>
<br>
typedef QVector<Point> Line;<br>
typedef QVector<Line> Polygon; // Can contain multiple rings
for holes<br>
<br>
class Geometry<br>
{<br>
static bool compare(const Point&, const Point&); // Point<br>
static bool compare(const Line&, const Line&); //
QVector<Point><br>
static bool compare(const Polygon&, const Polygon&); //
QVector<QVector<Point> ><br>
}<br>
<br>
>> Geometry.compare( [[Point(1,1), Point(2,2,)]],
[[Point(1,1), Point(2,2)]] )<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<span style="color: rgb(241, 241, 241); font-family: Monaco, monospace; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(68, 68, 68);">TypeError: index 0 has type 'list' but 'Point' is expected</span><br>
<br>
</body>
</html>