bartc wrote: > "Arnaud Delobelle" <arno...@googlemail.com> wrote in message > news:m28wb6ypfs....@googlemail.com... >> "Gabriel Genellina" <gagsl-...@yahoo.com.ar> writes: >> >>> En Fri, 05 Feb 2010 19:22:39 -0300, bartc <ba...@freeuk.com> escribió: >>>> "Steve Holden" <st...@holdenweb.com> wrote in message >>>> news:mailman.1998.1265399766.28905.python-l...@python.org... >>>>> Arnaud Delobelle wrote: >>>>>> Robert Kern <robert.k...@gmail.com> writes: >>>>>> >>>>>>> I prefer Guido's formulation (which, naturally, I can't find a >>>>>>> direct >>>>>>> quote for right now): if you expect that a boolean argument is only >>>>>>> going to take *literal* True or False, then it should be split into >>> ^^^^^^^^^^^^^^^^^^^^^^^ >>>>>>> two functions. >>>>>> >>>>>> So rather than three boolean arguments, would you have eight >>>>>> functions? >>>>>> >>>>> If there's genuinely a need for that functionality, yes. >>>> >>>> So you want a function such as drawtext(s, bold=true, italic=false, >>>> underline=true) to be split into: >>>> >>>> drawtext(s) >>>> drawtextb(s) >>>> drawtexti(s) >>>> drawtextu(s) >>>> drawtextbi(s) >>>> drawtextbu(s) >>>> drawtextiu(s) >>>> drawtextbiu(s) >>> >>> Note the *literal* part. If you (the programmer) is likely to know the >>> parameter value when writing the code, then the function is actually two >>> separate functions. >> >> Thanks, I understand what Steve Holden meant now. > > I've just noticed that 'literal' part. But I think I still disagree. > > For a real-world example, it means instead of having a room with a > light-switch in it, if I *know* I want the light on or off, I should > have two rooms: one with the light permanently on, and one with it > permanently off, and just walk into the right one. > Congratulations. That has to be the most bogus analogy I've seen on c.l.py this year.
regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/ Holden Web LLC http://www.holdenweb.com/ UPCOMING EVENTS: http://holdenweb.eventbrite.com/ -- http://mail.python.org/mailman/listinfo/python-list