[ZODB-Dev] Re: [Zope3-dev] Persistent module notes and proposal
Casey Duncan
casey at zope.com
Mon Jan 5 13:44:50 EST 2004
On Mon, 05 Jan 2004 20:17:42 +0200
Steve Alexander <steve at z3u.com> wrote:
>
> >> 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.
Hopefully if FooRegistry is itself a persistent object this would be ok? This does not mutate the module at all.
I agree with Tres that this rule should be strongly enforced. I am somewhat surprised that it would need to be a Zope-specific feature though. What makes it any more workable anywhere else? Sounds like unecessary complication to create a Zope specific restriction when no-one has demanded anything different outside of Zope. I strongly suggest we should not prematurely generalize policies outside of Zope until some real users and use-cases show up demanding it.
-Casey
More information about the ZODB-Dev
mailing list