On 07/20/2010 12:00 PM, Fred Drake wrote:
On Tue, Jul 20, 2010 at 12:47 PM, Ron Adam<r...@ronadam.com> wrote:
It doesn't fall under the single constant rule if done this way.
If the value for 'allow' were almost always given as a constant, this
would be an argument for three functions instead of one.
The guideline has little to do with the type of the value, but the
number of possible values ("small") and whether they're normally given
as constants in the code.
If there's more than one, and combinations then to vary, then keeping
them as args makes sense.
Also, if we don't know what we want the functionality to be, as you
suggest, then worry about that is premature. :-) Let's decide on the
required functionality first.
That makes sense. :-)
Another things that comes to mind, is it may make sense to choose either
strict, and have args to *allow* different cases, or to choose lenient, and
have args to *restrict* different cases.
That keeps it somewhat less confusing, and doesn't require memorization to
remember what the mixed mode default might be. (Unless we use a single
combination 99% of the time, then that probably *should* be the default.)
Ron
_______________________________________________
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