On Mon, May 9, 2016 at 2:57 PM, M.-A. Lemburg
Hmm, so if you'd typically pass in a constant for the parameter it's deemed poor style, whereas when the value comes from some variable, it's fine ?
Yes.
This looks more like an API design question than a coding style one.
Yes. IIRC the question that started this thread was about API design guidance.
E.g. take this example:
def process(data, raise_errors=True): try: ... return result except ValueError: if raise_errors: raise else: return None
It's not clear whether the caller would run the function with raise_errors=True or raise_errors=config.raise_errors more often.
Yeah, that's for the API designer to guess based on how they envision the API to be used. It's often pretty clear once you start writing some example code though. -- --Guido van Rossum (python.org/~guido)