Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80849 > unrolled thread

Re:Where is inspect() located?

Started byDave Angel <davea@davea.name>
First post2014-11-15 23:36 -0500
Last post2014-11-15 23:36 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re:Where is inspect() located? Dave Angel <davea@davea.name> - 2014-11-15 23:36 -0500

#80849 — Re:Where is inspect() located?

FromDave Angel <davea@davea.name>
Date2014-11-15 23:36 -0500
SubjectRe:Where is inspect() located?
Message-ID<mailman.15865.1416112573.18130.python-list@python.org>
Igor Korot <ikorot01@gmail.com> Wrote in message:
> Hi, ALL,
> 
> C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
> Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from a.b import c
>>>> print c.classA
> <class 'a.b.c.classA'>

And what is your question here?

>>>> inspect.getmembers(c.classA)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'inspect' is not defined

That's because you haven't imported it.

>>>> import lib
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named lib

The module is called inspect.

import inspect


> 


-- 
DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web