Issue 10275: how to know that a module is a module, a function is a function ? (original) (raw)
Issue10275
Created on 2010-11-01 04:41 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg120109 - (view) | Author: py.user (py.user) * | Date: 2010-11-01 04:41 |
>>> import os >>> m = os >>> type(m) <class 'module'> >>> isinstance(m, module) Traceback (most recent call last): File "", line 1, in NameError: name 'module' is not defined >>> n = 1 >>> type(n) <class 'int'> >>> isinstance(1, int) True >>> | ||
msg120110 - (view) | Author: Brian Curtin (brian.curtin) * ![]() |
Date: 2010-11-01 04:45 |
See the "types" module, specifically types.ModuleType. Compare that to your "type(os)" result. This is not a support channel. Please see python-list for these types of questions. | ||
msg120186 - (view) | Author: py.user (py.user) * | Date: 2010-11-01 23:03 |
Ok, thanks, I thought this is some kind of a bug |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:57:08 | admin | set | github: 54484 |
2010-11-01 23:03:34 | py.user | set | messages: + |
2010-11-01 04:45:51 | brian.curtin | set | status: open -> closednosy: + brian.curtinmessages: + resolution: rejectedstage: resolved |
2010-11-01 04:41:34 | py.user | create |