On Wed, Apr 4, 2012 at 9:04 PM, Victor Stinner <victor.stin...@gmail.com> wrote: > 2012/4/4 Antoine Pitrou <solip...@pitrou.net>: >> On Wed, 4 Apr 2012 02:02:12 +0200 >> Victor Stinner <victor.stin...@gmail.com> wrote: >>> > Lennart Regebro wrote: >>> >> Well, get_clock(monotonic=True, highres=True) would be a vast >>> >> improvement over get_clock(MONOTONIC|HIRES). >>> >>> I don't like this keyword API because you have to use a magically >>> marker (True). Why True? What happens if I call >>> get_clock(monotonic=False) or get_clock(monotonic="yes")? >> >> Since when are booleans magical? Has this thread gone totally insane? > > It depends if the option supports other values. But as I understood, > the keyword value must always be True.
If I were looking at that in documentation, my automatic guess would be that the only thing that matters is whether the argument compares-as-true or not. So get_clock(monotonic="yes") would be the same as =True, and =False wouldn't be. And get_clock(monotonic="No, you idiot, I want one that ISN'T") would... be stupid. But it'd still function :) Chris Angelico _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com