On this page
  1. threading.current_thread
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

threading.current_thread

Prev: threading.Condition | Up: threading | Next: threading.enumerate
Rel: threading.active_count, threading.Barrier, threading.BoundedSemaphore, threading.BrokenBarrierError
Ref: docs.python.org — threading.current_thread
Tags: #public #python3 #stdlib #threading


Import

import threading
from threading import current_thread

Signature & Overview

threading.current_thread()

Return the current Thread object, corresponding to the caller's thread of control.

Usage

import threading

cur = threading.current_thread()
assert isinstance(cur, threading.Thread) and cur.is_alive()

Gotchas

REPL Inspect

from threading import current_thread
help(current_thread)

Linked from

Related notes