Search code examples
python-3.xcollectionspycharmordereddictionary

weak warning in PyCharm: Unexpected argument


This inspection reports discrepancies between declared parameters and actual arguments, as well as incorrect arguments (e.g. duplicate named arguments) and incorrect argument order. Decorators are analyzed, too.

^That's what PyCharm is telling me. It's a weak warning, so my code runs fine.

import collections
var_dict = {}
var_dict = collections.OrderedDict(sorted(var_dict.items()))

^This is the line of code in question. I believe the warning has to do with the OrderedDict call.

I checked the OrderedDict documentation for Python 3.5, but I'm still nonplussed.

Why am I getting this warning? I'm using PyCharm Community Edition 5.0.1


Solution

  • I posted an issue - having similar warnings in Python 2. I believe it's a bug in their inspection (in PyCharm 5), but let's see how they respond.

    To moderators: this is a valid answer as recognized by the OP. It is not a "comment". Please read carefully before deleting.