[PyQt] PyQt4 Support for Multiple APIs

Phil Thompson phil at riverbankcomputing.com
Fri Feb 5 17:03:54 GMT 2016


On 30 Jan 2016, at 6:28 pm, Dmitry Shachnev <mitya57 at ubuntu.com> wrote:
> 
> Hi Phil,
> 
> On Sat, Jan 30, 2016 at 06:15:46PM +0000, Phil Thompson wrote:
>> As you probably know, PyQt4 supports multiple, incompatible APIs...
>> 
>> http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
>> 
>> The old APIs were the default for Python v2 and the new ones the default for
>> Python v3.
>> 
>> The feature was added to aid in the porting of applications from Python v2
>> to Python v3. It was never intended that production code should make use of
>> it - although I doubt I ever made that as explicit as I should have. For
>> example, all the packages used by an application must agree to use the same
>> APIs, which makes using third-party code problematic.
>> 
>> With hindsight it's something I wish I'd never implemented. The code to
>> support it is complex and is unlikely to be used again in the future - so it
>> will probably not get tested properly. Consequently I'm considering dropping
>> the support in SIP v4.18 and PyQt v4.12.
>> 
>> Please let me know if you are switching to the later APIs in your Python v2
>> code. Hopefully nobody is, but maybe everybody is...
> 
> Do I understand it correctly that you want to completely remove the sip.setapi
> method?
> 
> There *is* code that uses sip.setapi in production — around 39 packages in
> Debian according to our codesearch [1].
> 
> [1]: https://codesearch.debian.net/results/sip.setapi/page_0
>     (a big part of the results are sip4/python-qt4 themselves, to get results
>     for other packages click on their names in the list on page top)

Ok, I give up. I'll leave things as they are.

Phil


More information about the PyQt mailing list