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

Function getcontext

tools/python-3.11.9-amd64/Lib/_pydecimal.py:448–460  ·  view source on GitHub ↗

Returns this thread's context. If this thread does not yet have a context, returns a new context and sets this thread's context. New contexts are copies of DefaultContext.

()

Source from the content-addressed store, hash-verified

446)
447
448def getcontext():
449 """Returns this thread's context.
450
451 If this thread does not yet have a context, returns
452 a new context and sets this thread's context.
453 New contexts are copies of DefaultContext.
454 """
455 try:
456 return _current_context_var.get()
457 except LookupError:
458 context = Context()
459 _current_context_var.set(context)
460 return context
461
462def setcontext(context):
463 """Set this thread's context to context."""

Callers 15

localcontextFunction · 0.85
__new__Method · 0.85
_check_nansMethod · 0.85
_compare_check_nansMethod · 0.85
__str__Method · 0.85
__neg__Method · 0.85
__pos__Method · 0.85
__add__Method · 0.85
__mul__Method · 0.85
__truediv__Method · 0.85
__divmod__Method · 0.85
__mod__Method · 0.85

Calls 3

ContextClass · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected