Comment

Peter Bengtsson

Of course! Why didn't I think of that. It's just a bit strange to create something that is never assigned to something else. Thanks for the tip

Parent comment

James Gray

You don't need the map in order to get what you want. You could do something like this: [pprint(x) for x in dir(o) if not x.endswith('__roles__')] The fun thing about list-comprehensions is that you can 'filter' and 'map' all in one shot.