diff options
Diffstat (limited to 'python/helpers/pycharm_generator_utils/util_methods.py')
-rw-r--r-- | python/helpers/pycharm_generator_utils/util_methods.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/python/helpers/pycharm_generator_utils/util_methods.py b/python/helpers/pycharm_generator_utils/util_methods.py index b6805c4a5942..273b0a20b715 100644 --- a/python/helpers/pycharm_generator_utils/util_methods.py +++ b/python/helpers/pycharm_generator_utils/util_methods.py @@ -115,6 +115,25 @@ class __function(object): """ return txt +def create_method(): + txt = """ +class __method(object): + '''A mock class representing method type.''' + + def __init__(self): +""" + if version[0] == 2: + txt += """ + self.im_class = None + self.im_self = None + self.im_func = None +""" + if version[0] >= 3 or (version[0] == 2 and version[1] >= 6): + txt += """ + self.__func__ = None + self.__self__ = None +""" + return txt def _searchbases(cls, accum): # logic copied from inspect.py |