Re: question
Magnus Lie Hetland <[email protected]>
| Newsgroups | gmane.comp.python.anygui.devel |
|---|---|
| Message-ID | <[email protected]> |
Samuele Pedroni <[email protected]>: > > Hi. > > Why [snip] > vs. > def noWidget(self): > try: > return isinstance(self.widget,DummyWidget) > except AttributeError: > return 1 Kneejerk reaction against type checking (evil, evil ;) The current versions allows for any sort of signature-equivalent dummies, not just the specific one in question. Not very useful, perhaps, but all other things being equal, I'd rather avoid type checking... :] On the other hand, this dummy system may not be the best way of handling the situation at all -- I didn't really give it long and hard thought between I implemented it. Perhaps there could be some other way of doing this stuff... The idea was to avoid checking for dummies in all the get/set methods. It seems that some has snuck back, at least in the getters, to avoid returning None where a string or number is expected, for instance. Not ideal... (BTW: There is a function in Util that does this dummy-checking job, so there is actually duplicated functionality here, with this method.) -- Magnus Lie Hetland The Anygui Project http://hetland.org http://anygui.org ------------------------------------------------------- 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