mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-9342 Distinguish between function and method types
This commit is contained in:
@@ -1009,6 +1009,8 @@ class ModuleRedeclarator(object):
|
||||
self.classes_buf.out(0, txt)
|
||||
txt = create_function()
|
||||
self.classes_buf.out(0, txt)
|
||||
txt = create_method()
|
||||
self.classes_buf.out(0, txt)
|
||||
|
||||
# Fake <type 'namedtuple'>
|
||||
if version[0] >= 3 or (version[0] == 2 and version[1] >= 6):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user