Old-style keyword arguments don't work
Bug #277199 reported by
Nathan Davis
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyMultimethods |
Fix Committed
|
Medium
|
Nathan Davis |
Bug Description
Using keyword arguments with new-style classes works great. When used with old-style keywords, however, the call fails to resolve. Instead, a NotImplementedError is thrown.
Changed in pymultimethods: | |
assignee: | nobody → davisn90210 |
importance: | Undecided → Medium |
milestone: | none → release-0.1 |
status: | New → Confirmed |
To post a comment you must log in.
After investigation, it appears the problem is with _isinstance(). It checks to see if cls is an instance of type (to distinguish between actual classes and ClassIDs). This is sufficient for new-style classes, but neglects to handle old-style classes properly because they are not of type type (they are ClassType).
Adding an additional check for type ClassType should fix the problem. Alternatively, we could negate the logic and check for type ClassID. The only "disadvantage" is that it would require users to use the ClassID class (which I think is already necessary anyway, in order for rules to be created properly).