sdvillal / whatami

Easily provide python objects with self-identification
Other
9 stars 1 forks source link

Explicitly not support modules #18

Open sdvillal opened 6 years ago

sdvillal commented 6 years ago

At the moment modules are not supported in what2id (and in general). Probably we should check first if an object is a module and if so, raise NonSupported before jumping into further trouble.

Related, this is a funny case I just run into (notice that here whatami does have a what member):

python -c 'import whatami; whatami.what2id(whatami)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/whatever/lib/python2.7/site-packages/whatami/whatutils.py", line 37, in what2id
    return obj.what().id()
TypeError: 'module' object is not callable