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

Function _get_stack_depth

markdown/util.py:166–174  ·  view source on GitHub ↗

Get current stack depth, performantly.

(size: int = 2)

Source from the content-addressed store, hash-verified

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

Callers 1

nearing_recursion_limitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected