It is wrong to compare a name to a type.  This should probably more correctly be

```python
if mname not in (desc['name']['srcname'], desc['name']['tarname'], '__init__'):
```

How does this work for you.