[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] Interesting python inspection



On 08/19/2010 10:28 AM, Jason Dobies wrote:
> PyCharm just flagged the following code with a warning (in particular
> the consumerids argument)
> 
> def create(self, id, description, consumerids=[]):
> 
> Here's the warning:
> 
> "This inspection detects when a mutable value as list or dictionary is
> detected in a default value for an argument. Default argument values are
> evaluated only once at function definition time, which means that
> modifying the default value of the argument will affect all subsequent
> calls of the function. "
> 
> That's kinda cool, I never saw anything like that before.
> 
It knows...
_______________________________________________
Pulp-list mailing list
Pulp-list redhat com
https://www.redhat.com/mailman/listinfo/pulp-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]