Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'made.': 0.07; 'suppose': 0.07; 'tool,': 0.07; '"c"': 0.09; 'ide': 0.09; 'okay': 0.09; 'similar,': 0.09; 'skip:% 20': 0.09; "wouldn't": 0.14; 'changes': 0.15; '-tkc': 0.16; 'abbreviated': 0.16; 'from:addr:python.list': 0.16; 'from:name:tim chase': 0.16; 'grep': 0.16; 'optionally': 0.16; 'refactoring': 0.16; 'roy': 0.16; 'folks': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'tells': 0.24; 'regardless': 0.24; 'header:In-Reply-To:1': 0.27; 'leave': 0.29; '[1]': 0.29; '[2]': 0.30; 'that.': 0.31; 'too.': 0.31; 'comments,': 0.31; 'issuing': 0.31; 'subject:development': 0.31; 'allows': 0.31; 'probably': 0.32; "i'd": 0.34; 'could': 0.34; 'common': 0.35; 'something': 0.35; 'etc': 0.35; 'but': 0.35; 'useful': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'list': 0.37; 'step': 0.37; 'handle': 0.38; 'to:addr:python-list': 0.38; 'embedded': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; 'even': 0.60; 'most': 0.60; 'valuable': 0.63; 'email addr:yahoo.com': 0.64; 'smith': 0.68; 'money': 0.72; 'evaluate': 0.72; 'article': 0.77; 'received:50.22': 0.84; 'results,': 0.84; 'navigate': 0.91; 'hand,': 0.93 Date: Sun, 23 Jun 2013 19:54:26 -0500 From: Tim Chase To: python-list@python.org Subject: Re: Python development tools In-Reply-To: References: <93adcb76-2298-41bb-b5cb-cca525c6be21@googlegroups.com> <263da442-0c87-41df-9118-6003c616895c@googlegroups.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372035170 news.xs4all.nl 15920 [2001:888:2000:d::a6]:59862 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49018 On 2013-06-23 20:22, Roy Smith wrote: > In article , > rurpy@yahoo.com wrote: >> Other things like finding all uses of various objects/functions >> etc would also be useful now and then but I suppose that is a >> common IDE capability? > > $ find . -name '*.py' | xargs grep my_function_name > > seems to work for me. I suppose a language-aware grep would be > even better, because then it wouldn't find my_function_name when > it's embedded in docstrings, comments, and the like. > > On the other hand, you probably want to find those too. Most good editors (and IDEs?) should handle this as well. I can speak for Vim where I could do something like[1] sh$ vim *.py :set hidden :argdo %s/\/new_func_name/gc then evaluate the results, optionally issuing ":wall" to write all the changes. Alternatively, if you just want to find all the pattern-matches and view them, you can use :vimgrep /\/ **/*.py and then navigate them either using the quick-fix window: :copen or go forward/backwards in the quick-fix list with[2] :cnext :cprevious I'd wager money that Emacs allows you to do something similar, but I'd have to let an Emacs-user step in to answer that. YMMV with other editors. Is this a "refactoring" tool, or just a valuable tool, regardless of how it's used for refactoring :-) -tkc [1] The ":set hidden" tells Vim that it's okay to leave a buffer without writing it, but still remember the changes made. Many folks have this in their vimrc configuration. If you know you want to do it everywhere, you can avoid the "c" flag to ask for confirmation. [2] These can be abbreviated as just ":cn" and ":cp" .