2016-02-05 02:03:01 +08:00
|
|
|
from __future__ import print_function
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
# System modules
|
|
|
|
import inspect
|
|
|
|
|
|
|
|
# Third-party modules
|
|
|
|
|
|
|
|
# LLDB modules
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-02-05 02:03:01 +08:00
|
|
|
def requires_self(func):
|
|
|
|
func_argc = len(inspect.getargspec(func).args)
|
2016-09-07 04:57:50 +08:00
|
|
|
if func_argc == 0 or (
|
|
|
|
getattr(
|
|
|
|
func,
|
|
|
|
'im_self',
|
|
|
|
None) is not None) or (
|
|
|
|
hasattr(
|
|
|
|
func,
|
|
|
|
'__self__')):
|
2016-02-05 02:03:01 +08:00
|
|
|
return False
|
|
|
|
else:
|
|
|
|
return True
|