Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-24 Thread Dmitry Vasiliev
Dieter Maurer wrote: Dmitry Vasiliev wrote at 2006-5-23 17:06 +0400: ... PEP-3100 suggest "just call the object and catch the exception" instead of use "callable()". So maybe we can write: try: ob() except: pass return ob Unfortunately exceptions still will be masked. Yes, and ther

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Dieter Maurer
Dmitry Vasiliev wrote at 2006-5-23 17:06 +0400: > ... >PEP-3100 suggest "just call the object and catch the exception" instead of use >"callable()". So maybe we can write: > >try: > ob() >except: > pass >return ob > >Unfortunately exceptions still will be masked. Yes, and therefore *NEVER

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Dieter Maurer
Philipp von Weitershausen wrote at 2006-5-23 17:02 +0200: > ... >callable() isn't even deprecated yet, so if it solves our problem, we >can use it IMO. Note that Zope 3 deliberately doesn't use it because of >the proxy problem. Zope 2 works around that by stripping >proxies/wrappers first (ob.aq_ba

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Benji York
Philipp von Weitershausen wrote: (Which is, btw, why I prefer direct imports and dislike zapi nowadays: it doesn't make clear what a particular API the function comes from). For that and other reasons: death to zapi! -- Benji York Senior Software Engineer Zope Corporation _

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Chris Withers
Dmitry Vasiliev wrote: try: ob() except: pass Please god, no bare excepts! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http:

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Philipp von Weitershausen
Stephan Richter wrote: > On Tuesday 23 May 2006 11:02, Philipp von Weitershausen wrote: >> Would callable(removeAllProxies(obj)) be harmful in any way if you >> end up calling the proxied obj() anyway? > > No, we do this for zapi.isinstance as well. Well, yeah, zapi.isinstance really is from zope

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Stephan Richter
On Tuesday 23 May 2006 11:02, Philipp von Weitershausen wrote: > Would callable(removeAllProxies(obj)) be harmful in any way if you > end up calling the proxied obj() anyway? No, we do this for zapi.isinstance as well. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Ph

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Philipp von Weitershausen
Dmitry Vasiliev wrote: > Philipp von Weitershausen wrote: >> Hi there, >> >> I've filed an issue in the collector outlining a problem with old style >> classes and TALES traversal: http://www.zope.org/Collectors/Zope3-dev/635 >> >> In particular, I'm looking for comments on problem #2. > > PEP-310

Re: [Zope3-dev] TALES PathExpr doesn't call old style classes

2006-05-23 Thread Dmitry Vasiliev
Philipp von Weitershausen wrote: Hi there, I've filed an issue in the collector outlining a problem with old style classes and TALES traversal: http://www.zope.org/Collectors/Zope3-dev/635 In particular, I'm looking for comments on problem #2. PEP-3100 suggest "just call the object and catch