question

"Samuele Pedroni" <[email protected]>
Newsgroups gmane.comp.python.anygui.devel
Message-ID <00f401c25214$1ab83aa0$6d94fea9@newmexico>
Hi.

Why

class AbstractWrapper:

    def noWidget(self):
        """
        Returns true if this wrapper's widget has not yet been
        created by the backend (i.e. it doesn't exist, or is
        a DummyWidget).
        """
        try:
            try:
                widget = self.widget
            except AttributeError:
                return 1
            assert(widget.isDummy())
            return 1
        except (AttributeError,AssertionError):
            return 0

vs.

    def noWidget(self):
       try:
         return isinstance(self.widget,DummyWidget)
       except AttributeError:
         return 1

or even

    def noWidget(self):
         return isinstance(self.widget,DummyWidget)





-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.