Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28965 > unrolled thread

Re: avoid the redefinition of a function

Started byD'Arcy Cain <darcy@druid.net>
First post2012-09-12 09:51 -0400
Last post2012-09-12 09:51 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: avoid the redefinition of a function D'Arcy Cain <darcy@druid.net> - 2012-09-12 09:51 -0400

#28965 — Re: avoid the redefinition of a function

FromD'Arcy Cain <darcy@druid.net>
Date2012-09-12 09:51 -0400
SubjectRe: avoid the redefinition of a function
Message-ID<mailman.561.1347458405.27098.python-list@python.org>
On Wed, 12 Sep 2012 14:56:12 +0200
Jabba Laci <jabba.laci@gmail.com> 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 <darcy@druid.net>         |  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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web