On Mar 24, 5:39 pm, Peter Waller wrote:
> I've since heard that a 'better way' would be to use pyparsing. Also,
> I saw that python has dropped the idea of having recursive regular
> expressions at the moment.
I've written a pyparsing parser which is very much shorte
that python has dropped the idea of having recursive regular
expressions at the moment.
http://bugs.python.org/msg83993
Maybe I might re-implement this with pyparsing and some unit tests.
On Mar 24, 2:30 pm, Nick Craig-Wood wrote:
> Peter Waller wrote:
> > Okay, I got fed up with ther
What one really wants is a re option capable of handling recursive
structures, something along the lines of what PHP has:
http://uk2.php.net/manual/en/regexp.reference.php
Under the 'Recursive Patterns' heading. As far as I am aware, no such thing
exists for Python (yet?).
2009/
2009/3/24 Tino Wildenhain
>
>
> The simple {foo} expansion you mention should be quite easily handled
> with re.sub and a function as argument. So not much more then a few
> lines of code.
Could this approach be made to handle recursive expansion? From the example
with the script:
pprint(BraceE
Okay, yuck. I didn't realise that posting would mangle the code so
badly. Is there any better way to attach code? I'm using google
groups.
On Mar 24, 12:28 pm, Peter Waller wrote:
> Okay, I got fed up with there not being any (obvious) good examples of
> how to do bash-like br
Okay, I got fed up with there not being any (obvious) good examples of
how to do bash-like brace expansion in Python, so I wrote it myself.
Here it is for all to enjoy!
If anyone has any better solutions or any other examples of how to do
this, I'd be glad to hear from them.
#~ BraceExpand.py - B
On Sep 12, 2:30 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
>
> The answer to why this doesn't work lies in the disassembly of that
> function:
This makes me want to ask: is it difficult to modify a function's
code? Even if it weren't possible whilst the function was executing
(because then I wou
Dear Pythoners,
I know this will probably be perceived as 'evil voodoo', and fair
enough: it probably is. I guess it is unpythonic.
.. but I want to know how to do it anyway - mostly for my own
interest.
Consider the following snippet of code:
---
def Get( *names ):
if not names: return Non