[Zope-dev] zope.proxy explanation?

2010-11-20 Thread Lennart Regebro
I'm trying to port zope.proxy to Python 3, and most tests seem to
work, but investigating those two who doesn't is confusing. The first
one is the test to prevent pickling. This works under Python 2, but as
I understand it it should work by implementing a __reduce__ function
that throws an exception. But that method is never called under Python
2. Instead a pickling error is thrown, but this is because the pickler
has no special knowledge about proxies, and then tries to find
__reduce__ and fails. Apparently the __reduce__of the proxy isn't
found, weirdly enough.

In Python 3, the base object now *has* __reduce__, so it *is* found
and used, so the test fails.

So there is something I'm missing here. It seems to be that two bugs
cancel each other out under Python 2, and under Python 3 they don't,
and the test fails.

//Lennart
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] zope.proxy, c-extensions fallback?

2009-07-08 Thread Jens W. Klein
Hi, 
I'am just playing with repoze.bfg in google appengine (gae) and stumbled 
over zope.proxy. I tried to use zodict.node.Node which depends on 
zope.location. zope.location depends on zope.proxy. Latter has mandatory 
C-extensions.
Are there any plans to get rid of them as a fallback for those spezial 
cases like gae? For zope.interface it was possible too ...

tia
-- 
Jens W. Klein - Klein  Partner KEG - BlueDynamics Alliance

___
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] zope.proxy

2009-06-26 Thread Martin Aspeli
Hi,

Is there any documentation on zope.proxy other than the test? I don't 
speak C anymore. :)

Basically, I'm curious if it would be possible to implement translation 
proxies that would allow getting and setting translated values for 
certain fields.

Cheers,
Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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] zope.proxy

2009-06-26 Thread Malthe Borch
Martin Aspeli wrote:
 Is there any documentation on zope.proxy other than the test? I don't 
 speak C anymore. :)

I find ``zope.location.location.LocationProxy`` to be a good example of 
its usage.

\malthe

___
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] zope.proxy

2009-06-26 Thread Christian Theune
Hi there,

On Fri, 2009-06-26 at 18:30 +0800, Martin Aspeli wrote:
 Hi,
 
 Is there any documentation on zope.proxy other than the test? I don't 
 speak C anymore. :)
 
 Basically, I'm curious if it would be possible to implement translation 
 proxies that would allow getting and setting translated values for 
 certain fields.

I have done something like this a while ago and always wanted to release
it. 

*digs into svn*

Ah. We didn't use zope.proxy at all. We differentiate between a real
object and the object that carries the schema's translated fields.

Have a look at the attached file, it contains the code that I extracted
from a project in a hurry, but if the approach sounds reasonable to you,
I'd be happy to put that into SVN.

Christian

-- 
Christian Theune · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development


gocept.schematranslation.tar.gz
Description: application/compressed-tar


signature.asc
Description: This is a digitally signed message part
___
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] zope.proxy

2009-06-26 Thread Martin Aspeli
Hi Christian,

Thanks for this!

 Have a look at the attached file, it contains the code that I extracted
 from a project in a hurry, but if the approach sounds reasonable to you,
 I'd be happy to put that into SVN.

Can you tell me a bit more about how this is hooked into publication? 
Where do you create the Translation object? How do you look up 
translations later and present the correct translation to users?

Cheers,
Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

___
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 )