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

threading.get_ident

Prev: threading.ExceptHookArgs | Up: threading | Next: threading.get_native_id
Rel: threading.active_count, threading.Barrier, threading.BoundedSemaphore, threading.BrokenBarrierError
Ref: docs.python.org — threading.get_ident
Tags: #public #python3 #stdlib #threading


Import

import threading
from threading import get_ident

Signature & Overview

threading.get_ident()

Return a non-zero integer that uniquely identifies the current thread amongst other threads that exist simultaneously.

Usage

import threading

ident = threading.get_ident()
assert isinstance(ident, int) and ident != 0

Gotchas

REPL Inspect

from threading import get_ident
help(get_ident)

Linked from

Related notes