def _arg_count ( func ):
    if (type( func ) is MethodType) and (func.im_self is not None):
        return func.func_code.co_argcount - 1
    return func.func_code.co_argcount

#-------------------------------------------------------------------------------
#  Property error handling functions:
#-------------------------------------------------------------------------------
Returns the correct argument count for a specified function or method.
dataset/ETHPy150Open enthought/traits/traits/trait_handlers.py/_arg_count