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


Groups > comp.lang.python > #29000

Re: avoid the redefinition of a function

Date 2012-09-12 17:42 -0400
From D'Arcy Cain <darcy@druid.net>
Subject Re: avoid the redefinition of a function
References <CAOuJsMnLf4P9p_rZ4p1W-SndkSOV2WK_v5j1AET085LZ6bdavQ@mail.gmail.com> <5050938F.7030105@gmail.com> <CAOuJsMm6uANJNSRD=Qe70sBYWnnX55yF9dqxQTCcbx_nSfZGBg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.580.1347486138.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, 12 Sep 2012 18:56:46 +0200
Jabba Laci <jabba.laci@gmail.com> wrote:
> (5) install mc
> 
> You can type just "5" as user input and step_5() is called
> automatically. If I use descriptive names like install_java() then
> selecting a menu point would be more difficult. And I don't want users
> to type "java", I want to stick to simple numbers.

Your users shouldn't be working this out in any case.  Consider,
computer time is cheap.  Programmer time is not cheap but it is short
lived.  User time is forever.  Don't be lazy.  Parse the input and
prepare to present proper error messages just in case your users are
not perfect.

-- 
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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web