MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / visit_ClassDef

Method visit_ClassDef

tools/python-3.11.9-amd64/Lib/inspect.py:1035–1048  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

1033 visit_AsyncFunctionDef = visit_FunctionDef
1034
1035 def visit_ClassDef(self, node):
1036 self.stack.append(node.name)
1037 if self.qualname == '.'.join(self.stack):
1038 # Return the decorator for the class if present
1039 if node.decorator_list:
1040 line_number = node.decorator_list[0].lineno
1041 else:
1042 line_number = node.lineno
1043
1044 # decrement by one since lines starts with indexing by zero
1045 line_number -= 1
1046 raise ClassFoundException(line_number)
1047 self.generic_visit(node)
1048 self.stack.pop()
1049
1050
1051def findsource(object):

Callers

nothing calls this directly

Calls 5

ClassFoundExceptionClass · 0.85
appendMethod · 0.45
joinMethod · 0.45
generic_visitMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected