The Product API describes how to make simple objects but not "Folderish" ones. How do I find out how to do this? - Josh Zeidner Phylogenic Inc. _______________________________________________________________ Get Free Email and Do More On The Web. Visit http://www.msn.com
Why do DocumentTemplates and ZPublisher use regex instead of re? Since re is thread-safe and regex isn't, wouldn't it make sense to move things in the 're' direction? Or is Python 1.4 still being supported for these packages? One reason I ask is that I'm about to begin using regular expression in ZPublished code, and I'm wondering whether there's some special reason I should use regex instead of re. (Aside from the fact that it would mean not loading two different regular expression libraries, of course. :) )
"Phillip J. Eby" wrote:
Why do DocumentTemplates and ZPublisher use regex instead of re?
Two reasons: 1. Speed: regex is substantially faster than re 2. Intertia: we expect to change eventually, especially after re is optimized.
Since re is thread-safe and regex isn't, wouldn't it make sense to move things in the 're' direction?
regex can be used in thread-safe ways. AFAIK, all of the uses in DocumentTemplate and ZPublisher are thread safe. We are going through the rest of the Zope code to check for non-thread-safe uses of regex, regsub, and mutable "static" variables (e.g. global variables and function defaults).
Or is Python 1.4 still being supported for these packages?
No.
One reason I ask is that I'm about to begin using regular expression in ZPublished code, and I'm wondering whether there's some special reason I should use regex instead of re. (Aside from the fact that it would mean not loading two different regular expression libraries, of course. :) )
I don't have a strong opinion on this. Switching from regex to re is not very high on our priority list. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Thanks. I was more looking for reasons for or against *me* using re, not lobbying for Zope to go one way or the other. I was curious whether there were ones besides "it works, don't fix it" that would impact my own code. (E.g. speed, bugs in re, etc.) As it happened, after reading up on both regex and re, re had features that made things much easier for what I was doing (e.g. lookahead assertions) and so I went with that for the new code. I will try to stick with regex/t_regex for anything I want to contribute for inclusion back into Zope (e.g. DocumentTemplate extensions), however. At 09:43 AM 6/28/99 -0400, Jim Fulton wrote:
"Phillip J. Eby" wrote:
One reason I ask is that I'm about to begin using regular expression in ZPublished code, and I'm wondering whether there's some special reason I should use regex instead of re. (Aside from the fact that it would mean not loading two different regular expression libraries, of course. :) )
I don't have a strong opinion on this. Switching from regex to re is not very high on our priority list.
"Phillip J. Eby" wrote:
I will try to stick with regex/t_regex for anything I want to contribute for inclusion back into Zope (e.g. DocumentTemplate extensions), however.
This isn't necessary. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (3)
-
Jim Fulton -
Josh Zeidner -
Phillip J. Eby