'class' argument optional for new.instancemethod?

Martin Miller ggrp1.20.martineau at dfgh.net
Sat Mar 12 02:03:09 CET 2005

In section "3.27 new -- Creation of runtime internal objects" of the
documentation that comes with Python 2.4 it says:

> instancemethod(function, instance, class)
> This function will return a method object, bound to instance, or
unbound if
> instance is None. function must be callable.

However, some simple experiments I've tried seem to indicate that the
last argument, 'class' can be left off with no ill effects, and is
therefore optional.

Doesn't anyone know if this is a documention problem? Personally, I
don't understand how the argument gets used when it *is* provided -- if
nothing else, having it seems somewhat redundant given the presence of
the 'instance' argument.


More information about the Python-list mailing list