isinstance(x, types.CodeType). Suggested by Finn Bock.
Attach a file by drag & drop or click to upload