How the D3DShot singleton works
devWindows allows only one instance of Desktop Duplication per process. To prevent errors, d3dshot.create() implements a singleton pattern. Any subsequent calls to create() will return the existing instance rather than creating a new one. Note that because it returns the existing instance, you cannot change the capture_output configuration after the first instance is created.
d = d3dshot.create(capture_output="numpy")
# This returns the same instance 'd', and capture_output remains 'numpy'
d2 = d3dshot.create(capture_output="pil")
print(d == d2) # True