Re: avoid the redefinition of a function

Discussion in 'Python' started by D'Arcy Cain, Sep 12, 2012.

  1. D'Arcy Cain

    D'Arcy Cain Guest

    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:
    D'Arcy Cain, Sep 12, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jabba Laci

    avoid the redefinition of a function

    Jabba Laci, Sep 12, 2012, in forum: Python
    Replies:
    2
    Views:
    176
    Ramchandra Apte
    Sep 12, 2012
  2. Michael Torrie

    Re: avoid the redefinition of a function

    Michael Torrie, Sep 12, 2012, in forum: Python
    Replies:
    0
    Views:
    170
    Michael Torrie
    Sep 12, 2012
  3. Jabba Laci
    Replies:
    3
    Views:
    191
    Peter Otten
    Sep 13, 2012
  4. Tim Chase
    Replies:
    0
    Views:
    159
    Tim Chase
    Sep 12, 2012
  5. Terry Reedy
    Replies:
    0
    Views:
    167
    Terry Reedy
    Sep 12, 2012
Loading...

Share This Page