#!/usr/bin/env python import socket sock = socket.socket() sock.connect(('bugs.python.org', 80)) f = sock.makefile() #you can also verify this by looking #at the proc filesystem for this pid. #no new file handles are created assert f.fileno() != sock.fileno()