Re: How to test for isinstance(obj, sip.wrappertype)?
Phil Thompson <[email protected]> Sun, 19 Apr 2020 22:02:52 +0100
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <[email protected]> |
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 [email protected] https://www.riverbankcomputing.com/mailman/listinfo/pyqt