MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / _get_stack_depth

Function _get_stack_depth

markdown/util.py:169–177  ·  view source on GitHub ↗

Get current stack depth, performantly.

(size: int = 2)

Source from the content-addressed store, hash-verified

167
168
169def _get_stack_depth(size: int = 2) -> int:
170 """Get current stack depth, performantly.
171 """
172 frame = sys._getframe(size)
173
174 for size in count(size):
175 frame = frame.f_back
176 if not frame:
177 return size
178
179
180def nearing_recursion_limit() -> bool:

Callers 1

nearing_recursion_limitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected