Every line of 'python get function name' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
185 def get_func_name(func): 186 """Return function name""" 187 if PY2: 188 # Python 2 189 return func.func_name 190 else: 191 # Python 3 192 return func.__name__
137 def getFunctionName(functionID): 138 return mc._functionsDict[functionID].name
187 def func_name(f): 188 """Return the name of a function or class method.""" 189 if isinstance(f, string_types): 190 return f 191 elif hasattr(f, '__qualname__'): # pragma: no cover 192 return f.__qualname__ # Python 3 193 elif hasattr(f, 'im_class'): # pragma: no cover 194 return '{0}.{1}'.format(f.im_class.__name__, f.__name__) # Python 2 195 else: # pragma: no cover 196 return f.__name__ # Python 2
365 @property 366 def full_name(self) -> str: 367 return '::'.join([self.parent_namespace_generator.full_name, self.name])
361 @property 362 def name(self) -> str: 363 return self.function_object.name
191 def getFunctionName(inDecorator=False): 192 try: 193 if inDecorator: 194 return sys._getframe(2).f_code.co_name 195 return sys._getframe(1).f_code.co_name 196 except Exception: 197 return None
43 def funcName(func): 44 if ismethod(func): 45 return func.__func__.__name__ 46 47 if hasattr(func, 'func'): 48 return func.func.__name__ 49 50 return func.__name__
35 def callable_name(callable_obj): 36 """ 37 Extract the name of a callable object 38 39 :param callable_obj: Callable object 40 :type callable_obj: Any object as long as it is callable 41 42 :return: Either the function name or the name of the class of the callable 43 :rtype: ``str`` 44 """ 45 from .comparison import Callable 46 if isinstance(callable_obj, Callable): 47 return str(callable_obj) 48 49 doc = getattr(callable_obj, '__doc__', None) 50 if doc: 51 return doc.strip() 52 return (getattr(callable_obj, '__name__', None) or 53 callable_obj.__class__.__name__)
20 def _get_function_name(self): 21 return 'fx_{}'.format(self.id)
47 def get_let_name(method_name): 48 return method_name.split('_let_')[-1]