#5 Errors handling static and class methods

inspection (59)

The UID module chokes on static and class methods such
as __new__, because it doesn't realize they're methods.
Instead of just checking '_MethodType', make_uid
should check for the staticmethod and classmethod types
as well.

To support pre-2.2 versions, the list of types to check
should be encapsulated external to the make_uid
function, or else dummy 'staticmethod' and
'classmethod' variables could be created for older


  • Edward Loper

    Edward Loper - 2002-11-02

    Logged In: YES

    This should now be fixed in the development (CVS)
    version of the code. If you get a chance, I'd appreciate it
    if you could chech out the CVS code, and test it on your
    Python scripts, to make sure that it's giving the desired

    My fix ended up being somewhat different than you
    suggest. Basically, I changed the ClassDoc code to use
    dir() and getattr(...), rather than accessing fields through
    __dict__. This also solves a problem where __dict__
    does not include methods inherited from builtin types,
    because dir() *does* list them, and getattr(...) returns

    The HTML output currently lists all methods in a single
    list for "method summary," and breaks it out into 3
    separate details lists: method details; class method
    details; and instance method details. (If a details list is
    empty, then it is omitted). I would appreciate feedback
    on whether you think this is an appropriate way to
    present the methods to the user.

  • Edward Loper

    Edward Loper - 2002-11-02
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks