0

I'm trying to understand atomicity of this command with

import dis
import sys
dis.dis(sys.stderr.write)

However, I get "TypeError: don't know how to disassemble builtin_function_or_method objects"

How to determine atomicity of python built-in functions?

124bit
  • 496
  • 1
  • 3
  • 13

1 Answers1

0

You can't disassemble sys.stderr.write - it's not a python function, but a function written in C and only available in binary after installation.

Being a C function, it is implicitly thread-safe because of the Global Interpreter Lock (GIL).

loopbackbee
  • 21,962
  • 10
  • 62
  • 97