Old-style keyword arguments don't work

Bug #277199 reported by Nathan Davis
2
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
Revision history for this message
Nathan Davis (davisn90210) wrote :

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).

Changed in pymultimethods:
status: Confirmed → In Progress
Revision history for this message
Nathan Davis (davisn90210) wrote :

Fix and testcases committed in Subversion revision 9.

Changed in pymultimethods:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.