Mohamad Kanj added the comment:
Thanks Raymond for the input.
So with some experimentation, the __enter__() & __exit__() functions could be
traceable when other kinds of objects are used with the context manager (i.e
with statement using file IO or custom class objects). However, just
New submission from Mohamad Kanj :
The interception of Python and C functions is achieved through the `sys` module
- however, when using thread locks from `threading` module for instance under
context managers, the calls on the lock to `acquire()` and `release()` cannot
be witnessed
Change by Mohamad Kanj :
--
assignee: docs@python
components: C API, Demos and Tools, Distutils, Documentation
files: tracing-locking-mechanisms.py
nosy: docs@python, dstufft, eric.araujo, mhmdkanj
priority: normal
severity: normal
status: open
title: Intercepting thread lock objects