Looking into the code quickly after the discussion on dabo-users, it
seems fairly difficult to achieve the design of not instantiating an object if
beforeInit() returns boolean True. First, there are several layers of
inheritance and mixins, and this would be difficult to coordinate correctly.
But that is at least possible to do with enough effort; what looks like a much
bigger problem is that wx doesn't seem too happy if we return early from object
creation.
I briefly played around with the __new__() method of dObject, but that
opens up all sorts of parameter-passing complications. It also seemed to cause
problems with the sqlite cursors, which I didn't dig into any further.
I propose that we drop the design goal of preventing object
instantiation by returning values from beforeInit(). IMO, there isn't a strong
use case for it; the code that would do the checking in beforeInit() could just
as easily be run from the code that called for the object to be created.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]