<div dir="ltr"><div>Thank you for <a href="https://bugs.python.org/issue36048">this link</a>. I had wondered why lots of production code using PyQt was breaking upon updating old Linux installations, but I simply had no time to look into it and froze Python package versions, thinking it's the usual stuff with Guido van Rossum doing <i>things.</i></div><div><br></div><div>The PySide6 behavior described by Mark Dickinson in your link seems ideal, to me. Here's my vote for making PyQt adopt the same behavior. </div><div><br></div><div>It is appropriate for an interface to a C++ library, because C++ does and always will do implicit float / int conversion, except when explicitly forbidden by use of asserts with the type_traits library, overloads, etc.</div><div><br></div><div>Thanks,</div><div>Erik</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 13, 2022 at 10:57 AM meta <<a href="mailto:0x0meta@gmail.com">0x0meta@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<br><br>When using PyQt with previous versions of Python, a float can be passed where an int is expected e.g. QColor(0, 0, 0, 255 * some_float).<br><br>With 3.10 however, the same code gives the following error:<br>```<br>TypeError: arguments did not match any overloaded call:<br> QColor(Qt.GlobalColor): argument 1 has unexpected type 'int'<br> QColor(int): too many arguments<br> QColor(QRgba64): argument 1 has unexpected type 'int'<br> QColor(Any): too many arguments<br> QColor(): too many arguments<br> QColor(int, int, int, alpha: int = 255): argument 4 has unexpected type 'float'<br> QColor(str): argument 1 has unexpected type 'int'<br> QColor(Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'int'<br>```<br><br>Specifically `QColor(int, int, int, alpha: int = 255): argument 4 has unexpected type 'float'`.<br><br>I believe this is related to the following deprecation in 3.8 which was solidified in 3.10: <a href="https://bugs.python.org/issue36048" target="_blank">https://bugs.python.org/issue36048</a> <br><br>Cheers<br></div>
</blockquote></div></div>