[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] How to test for isinstance(obj, sip.wrappertype)?
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2020-04-19 21:02:52
Message-ID: 114e6fde12bf6a887b64095af2cd8414 () riverbankcomputing ! com
[Download RAW message or body]
On 19/04/2020 20:52, Steve Borho wrote:
> Hello,
>
> How does one test that a Python object is a SIP wrapped object?
>
> Python 3.7.7 (default, Mar 10 2020, 15:43:33)
> [Clang 11.0.0 (clang-1100.0.33.17)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from foo import barstruct
>>>> type(barstruct)
> <class 'sip.wrappertype'>
>>>> import sip
>>>> t = barstruct()
>>>> isinstance(t, sip.wrappertype)
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> AttributeError: module 'sip' has no attribute ‘wrappertype'
Works fine for me.
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic