[Zope-dev] Python Methods commited

Evan Simpson evan@4-am.com
Fri, 17 Dec 1999 14:41:59 -0600


Christopher Petrilli wrote:

> I've committed in Evan Simpson's Python Methods into the core distribution,

Woohoo!

> however there are a few changes, some minor, some major:
>
> * All pieces of the unsafe version have been removed, this is
> non-negotiable.

Do you mind if I put up an XXXPythonMethod Product for those reckless souls
who want them?

> * Object traversal, and traversal_subpath

In retrospect, these aren't necessary if people are willing to use
SiteAccess.  If they prove to be popular, you should probably remove their
"magical" quality and put an "Allow traversal?" checkbox on the main edit
form.

> * Access to things like the formatters via "magic namespace"

There have been several times when I've wanted access to these in *DTML*, much
less PMs, as in:
<dtml-call expr="REQUEST.set('foo',
??how_do_I_call_a_special_format??(the_text_to_format))">

 Yes, I could put a DTML Method in my root folder for each special format,
containing nothing but <dtml-var arg the_format>, but that's painfully
kludgy.  Perhaps dtml-let could be extended to allow something like:

<dtml-let foo=the_text_to_format html-quote upper bar="2+2">
<dtml-comment>Blech!</dtml-comment>

I'd rather just have them available in the same way that the _.string or
_.math stuff is, perhaps through _.string.format.*

That reminds me: Do you know why tuple, list, map, reduce, and filter aren't
surfaced?  Is it the "risk" of turning strings into lists?

Cheers,

Evan @ 4-am