Is this pylint error message valid or silly?

Aahz aahz at
Sat Jun 20 00:17:50 EDT 2009

In article <87eitg267e.fsf at>,
Ben Finney  <ben+python at> wrote:
>Matthew Wilson <matt at> writes:
>>     from datetime import datetime
>>     def f(c="today"):
>>         if c == "today":
>>                     c =
>>         return
>* You're re-binding the parameter name ‘c’ to something different within
>  the function: it starts out bound to the input string, but by the time
>  the function ends you're expecting it to be bound to a datetime
>  object. Instead, you should be binding a *different* name to the
>  datetime object you create inside the function, and using that for the
>  return statement.

Actually, I disagree that this is necessarily bad, although it's often a
yellow flag.  The context in which it is possibly appropriate is when you
want your function to handle multiple types for one parameter and you
always cast the data to one single type.
Aahz (aahz at           <*>

"as long as we like the same operating system, things are cool." --piranha

More information about the Python-list mailing list