Bash-like brace expansion

Nick Craig-Wood nick at craig-wood.com
Tue Mar 24 10:30:04 EDT 2009


Peter Waller <peter.waller at gmail.com> wrote:
>  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!

Interesting!

Might I suggest some unit tests?  You can then test all the corner
cases (unmatched brackets, empty brackets, etc) and be sure it works
exactly as specified.  doctest is cool for this kind of stuff.

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list