I am trying to use introspection to get a list of my objects. I read "Immersion in Python", and the above statement:
methodList = [method for method in dir(object) if callable(getattr(object, method))]
does the trick. The problem is that I have no idea what she is doing. For me, it looks like an extreme shorthand of the cycle, testing and adding items to the list. If I'm right, what part of the instructions does what ?!
In other words, can someone translate it into English.
source
share