Re: [Python-3000] how about switching to a preprocessor? (Re: A better way to initialize PyTypeObject)

2006-12-15 Thread Fernando Perez
Greg Ewing wrote: > Does anyone have any recommendations for a site > to host the repository? I'd really like to avoid > SourceForge if possible, as it makes me cringe > every time I go there -- cluttered pages, slow > response, way too complicated UI. You could contact Enthought: http://enthoug

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Guido van Rossum
Look at the WildcardPattern class in pytree.py. It generates all the matches like you say. I don't think it's worth trying to optimize this much; I'm just doing a very naive non-greedy expansion and so far it works fine, mostly because it only needs to match at one level in the tree, which in most

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Talin
Guido van Rossum wrote: > I'm not sure how thinking about it as an algebraic solver helps -- is > there any existing code I can borrow? I suppose it depends on how complex your rules are going to be. The matching algorithms used in solvers are specialized for some fairly difficult cases. Two exa

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Guido van Rossum
I'm taking the idea of using the same parser with a grain of salt -- by the time you have added all the pattern matching syntax IMO it will look too cluttered. Also, your concept of "variable" is too constrained -- the parenthesization should not only depend on the form of the experssion, but also

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Guido van Rossum
Hm, I thought it's not a conflict unless there are *three* versions. However, Jason's suggestion is correct: instead of writing a new tool for this purpose, we should leverage existing tools. Cool! I can focus on writing transformations. On 12/15/06, Jason Orendorff <[EMAIL PROTECTED]> wrote: > O

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Jason Orendorff
On 12/15/06, Anders J. Munch <[EMAIL PROTECTED]> wrote: > GvR wrote: > > > > Finally, I have a dream: a GUI that will let you do this > > interactively, sort of like query-replace in Emacs. But this message > > is already too long, so I'll stop for now. Thanks for reading this > > far. :-) > > Soun

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Niki Spahiev
Guido van Rossum wrote: > Second, the transformations can sometimes lose comments. For example, > if the input looks something like > > (x.has_key #blah > (y)) > > the #blah comment is lost, since there is no good place to put it in > the translation "(y in x)". What if result is (y in

Re: [Python-3000] Refactoring tool available (work in progress)

2006-12-15 Thread Anders J. Munch
GvR wrote: > > Finally, I have a dream: a GUI that will let you do this > interactively, sort of like query-replace in Emacs. But this message > is already too long, so I'll stop for now. Thanks for reading this > far. :-) Sounds like a job for revision control conflict resolution editors. Genera