[ZODB-Dev] Re: [Zope3-dev] Persistent module notes and proposal
Steve Alexander
steve at z3u.com
Mon Jan 5 13:17:42 EST 2004
>> This certainly sounds reasonable. We need to make sure this is
>> enforced at some level though, preferrably through software (disallowing
>> mutating globals in the module somehow) or at least through very strong
>> documentation (such as a comment at the top of the module that appears
>> by default or an electrostatic charge administered to the chair of the
>> respective programmmer). Otherwise I sense an endless barrage of newbie
>> FAQs re this in our future...
>
>
> Surely we can replace the __dict__ of the PM with something "frozen",
> thawing it only when recompiling the source. I wouldn't want anything
> "advisory" at all, here; that would be just a bug magnet (FAQs too).
I don't see how this will help.
Here's an example of a registry:
# this is the base level of indentation for the module
foo = FooRegistry()
foo.register('bar')
def register_something(thing):
foo.register(thing)
The registry itself will be changing, although its name in the module
will not be rebound.
--
Steve Alexander
More information about the ZODB-Dev
mailing list