Re: [Zope-dev] Re: Replaceable Property question
Chris Withers wrote: Shane Hathaway wrote: Will there be any access to the method/object that is being overridden from inside the one overriding it? Something like: 'self.__class__.my_method("blah")' Depends on whether the original method comes from a ZClass or product. If so, yes. But if it's a regular object that's marked as replaceable and it's replaced, the original will vanish. Will it re-appear when the replacement is deleted? That could be confusing... No, and I think it's really not confusing, since it's quite a strange and rare thing to set __replaceable__=ObjectManager.REPLACEABLE on a normal instance. :-/ Think of it more like Python instances vs. classes. Setting __replaceable__=REPLACEABLE on a ZClass method is like setting a class attribute in Python, then overriding it in an instance is like setting an instance attribute. If you set __replaceable__=REPLACEABLE on an instance attribute, then replace it, it's like setting "foo.a = bar" then "foo.a = boo". The reference to "bar" disappears without any implicit recovery. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Replaceable Property question
Shane Hathaway wrote: Will it re-appear when the replacement is deleted? That could be confusing... No, and I think it's really not confusing, since it's quite a strange and rare thing to set __replaceable__=ObjectManager.REPLACEABLE on a normal instance. :-/ Very true :-) Think of it more like Python instances vs. classes. Setting __replaceable__=REPLACEABLE on a ZClass method is like setting a class attribute in Python, then overriding it in an instance is like setting an instance attribute. If you set __replaceable__=REPLACEABLE on an instance attribute, then replace it, it's like setting "foo.a = bar" then "foo.a = boo". The reference to "bar" disappears without any implicit recovery. Hurm, that is a shame... What happens if you override a method (say Squishdot.render) and then delete your overriding method? Does it depend on whether you're talking about python products or ZClasses? cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Re: Replaceable Property question
So, how long before this becomes a project and gets finished? 2.2.1 would be great :-)) thanke for the great work, Chris Note that third-dot releases are bug-fix only. New features go into second-dot releases. Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Replaceable Property question
Brian Lloyd wrote: So, how long before this becomes a project and gets finished? 2.2.1 would be great :-)) thanke for the great work, Chris Note that third-dot releases are bug-fix only. New features go into second-dot releases. I agree with this policy in principle. However, because various nice things in PTK and projects using ZPatterns depend on the replaceable property, I can see quite a lots of patched 2.2.x installations until the 2.3.x series is released :-/ I wonder what other features are planned for 2.3... -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Replaceable Property question
Chris Withers wrote: Brian Lloyd wrote: So, how long before this becomes a project and gets finished? 2.2.1 would be great :-)) thanke for the great work, Chris Note that third-dot releases are bug-fix only. New features go into second-dot releases. D'oh ;-) How long is 2.3 likely to be? IIUC, PTK is going to live off this project a lot... Actually, PTK will work without it but it won't be secure. People will be able to add "portal_xxx" objects without any protection. This *should* be okay for now, since we're primarily in development mode, but Brian and Jim have stated before that should the need arise, releasing a second-dot version can happen at any time. OTOH __replaceable__ support has just been checked into the trunk and if you're working from the CVS repository, just do a "cvs up"! Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Replaceable Property question
Shane Hathaway wrote: but Brian and Jim have stated before that should the need arise, releasing a second-dot version can happen at any time. That sounds promising :-) OTOH __replaceable__ support has just been checked into the trunk and if you're working from the CVS repository, just do a "cvs up"! Cool... I'd just like to say a big thanks again to Shane and Phil for making it happen :-)) Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )