Why dir doesn't show all Python object attributes?

Viewed 1557

Why do some object methods/attributes not show up when I call dir on the object?

Example:

from scipy import sparse
e = sparse.eye(2)
'H' in dir(e)

returns False. But calling e.H works just fine (returning another sparse matrix object). Why is this so, and how can I see these hidden attributes?

I'm using Python 3.5.1.

1 Answers
Related