Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1792: applied patch for broken ZClasses

2005-06-13 Thread Florent Guillaume
Andreas Jung  <[EMAIL PROTECTED]> wrote:
> --On 13. Juni 2005 17:15:40 +0200 Florent Guillaume <[EMAIL PROTECTED]> wrote:
> > Not caused by this patch, but shouldn't this be '_v_' instead of '_v' ?
> > ZODB/persistentclass.py has the same code, by the way...
> >
> 
> Likely you're right. Wanna fix it? :-)

Sure, but first I wanted to understand a bit the inheritance of code
between ZODB/persistentclass.py and ZClasses/_pmc.py. The __setattr__
and __getattr__ code appear to be similar in these two files (although
apparently inheritance cannot be done), so I wondered if the recent fix
in _pmc.py appear was needed in persistentclass.py too. Probably only
Jim knows that code well.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1792: applied patch for broken ZClasses

2005-06-13 Thread Andreas Jung



--On 13. Juni 2005 17:15:40 +0200 Florent Guillaume <[EMAIL PROTECTED]> wrote:



Not caused by this patch, but shouldn't this be '_v_' instead of '_v' ?
ZODB/persistentclass.py has the same code, by the way...




Likely you're right. Wanna fix it? :-)

-aj


pgp67VXrZxfgq.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1792: applied patch for broken ZClasses

2005-06-13 Thread Florent Guillaume
> Modified: Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py
> ===
> --- Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py 2005-06-10 
> 23:57:01 UTC (rev
> 30750)
> +++ Zope/branches/Zope-2_8-branch/lib/python/ZClasses/_pmc.py 2005-06-11 
> 06:20:42 UTC (rev
> 30751)
> @@ -56,15 +56,20 @@
>  ExtensionClass.pmc_init_of(result)
>  return result
>  
> +# copy_reg.py:_slotnames() tries to use this attribute as a cache.
> +# Dont allow this attribute to be written as it may cause us
> +# to register with the data_manager.
> +__slotnames__ = property(None)
> +
>  def __setattr__(self, name, v):
> +super(ZClassPersistentMetaClass, self).__setattr__(name, v)
>  if not ((name.startswith('_p_') or name.startswith('_v'))):
>  self._p_maybeupdate(name)
> -super(ZClassPersistentMetaClass, self).__setattr__(name, v)

Not caused by this patch, but shouldn't this be '_v_' instead of '_v' ?
ZODB/persistentclass.py has the same code, by the way...

Florent

>  
>  def __delattr__(self, name):
> +super(ZClassPersistentMetaClass, self).__delattr__(name)
>  if not ((name.startswith('_p_') or name.startswith('_v'))):
>  self._p_maybeupdate(name)
> -super(ZClassPersistentMetaClass, self).__delattr__(name)
>  


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )