Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'function,': 0.07; '425': 0.09; 'sep': 0.09; 'cc:addr:python-list': 0.10; 'read.': 0.13; '(like': 0.15; 'im:': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'duplicate': 0.17; '+0200': 0.20; 'voting': 0.22; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'functions.': 0.27; 'function': 0.30; 'code': 0.31; 'function.': 0.33; 'problem': 0.33; 'there': 0.35; 'but': 0.36; 'charset:us- ascii': 0.36; 'subject:: ': 0.38; 'easier': 0.38; 'called': 0.39; 'think': 0.40; 'your': 0.60; 'real': 0.61; 'header:Message-Id:1': 0.62; 'harder': 0.65; 'democracy': 0.84; 'received:98.158': 0.84 Date: Wed, 12 Sep 2012 09:51:44 -0400 From: D'Arcy Cain To: Jabba Laci Subject: Re: avoid the redefinition of a function In-Reply-To: References: X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Python mailing list 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347458405 news.xs4all.nl 6869 [2001:888:2000:d::a6]:38591 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28965 On Wed, 12 Sep 2012 14:56:12 +0200 Jabba Laci wrote: > This will call the 2nd function. Now my functions are called step_ID > (like step_27(), step_28(), etc.). How to avoid the danger of > redefinition? Now, when I write a new function, I search for its name > to see if it's unique but there must be a better way. I think your real problem is how you name your functions. Give them names that describe the operation that they do such as step_get_finagle, step_update_konkle, etc. It's harder to duplicate those unless you actually duplicate a function and it will make your code much easier to read. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. IM: darcy@Vex.Net