By using the thread's repr() we get its type, name, daemon status and ID, all at one time. No need to include them separately. Fall back to the threadId in case the repr() is empty, which can happen for exotic threads (the gevent main thread seems to be like that)