You mean rudimentary type check?
Hmmm, what about isinstance(cgroup, str)...