Warning when calling obsolete Qt methods?

Florian Bruhin me at the-compiler.org
Fri Aug 27 12:58:22 BST 2021


Hi,

On Fri, Aug 27, 2021 at 02:35:42PM +0300, Dmitry Shachnev wrote:
> On Fri, Aug 27, 2021 at 12:22:58PM +0100, Phil Thompson wrote:
> > I'm against it because of the maintenance overhead

Fair point - I don't know how metasip works exactly, but I suppose it
would be possible for it to let you know if something was obsoleted in a
new Qt release?

> > and the possible appearance of annoying warnings to the user of an
> > application.

IIRC Python hides deprecation warnings outside of __main__ by default:
https://www.python.org/dev/peps/pep-0565/

> > It would be different if the deprecated methods where to be removed but they
> > never are.
> 
> A lot of methods that were deprecated in Qt 5 were removed in Qt 6.
> 
> So having deprecation warnings in PyQt6 would help developers to make their
> apps compatible with future Qt 7.

Indeed - but also, there's usually a good reason a method gets
deprecated. Sometimes it's just "whoops, we found a better name", but
often it's "oh, this method actually does something unexpected in a
certain corner case, but we can't fix it in a backwards-compatible way".

Even if they aren't getting removed, they are potential footguns, and
(contrary to the C++ world) there's currently no way for a PyQt
developer to find out which footguns they might be using accidentally.

Florian

-- 
            me at the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210827/67ba191e/attachment-0001.sig>


More information about the PyQt mailing list