Re: [Python-Dev] Extracting variables from string.Template objects

2008-01-08 Thread Aahz
On Fri, Jan 04, 2008, Isaac Morland wrote: > On Fri, 4 Jan 2008, Aahz wrote: > >>>Also, on a related issue, does it make sense to scan the template >>>string for invalid escape sequences in Template.__init__? For the >>>applications I can imagine of string.Template, I would prefer to get >>>an er

Re: [Python-Dev] Extracting variables from string.Template objects

2008-01-04 Thread Isaac Morland
On Fri, 4 Jan 2008, Aahz wrote: >> Also, on a related issue, does it make sense to scan the template >> string for invalid escape sequences in Template.__init__? For the >> applications I can imagine of string.Template, I would prefer to get >> an error upon creating the Template object rather th

Re: [Python-Dev] Extracting variables from string.Template objects

2008-01-04 Thread Aahz
On Fri, Jan 04, 2008, Isaac Morland wrote: > > I would like to add this as a method of string.Template, which I think > amounts to changing "template" to "self" and putting it in the Template > class in string.py rather than on its own. If the general idea is > approved I would be happy to make

[Python-Dev] Extracting variables from string.Template objects

2008-01-04 Thread Isaac Morland
I found myself wanting to obtain the variables from a string.Template object. The situation is that part of input consists of a filename template, and I want to make sure that all the parameter values I have are actually represented in the filename template. So: def templateVariables (templat