Just a quick note:
I tried import inspect under jython 2.2rc3, and it works fine, but it fails
under jython 2.1.
Is this normal?
Please let me know. Thanks.
On 8/22/07, Jake B <otakuj462@...> wrote:
> Thank you for the quick replies! Jythonconsole is very interesting. Also,
> I found that the commercial version of Pydev supports some autocompletion
> and autoimports libraries. Unfortunately, Pydev autocompletion doesn't work
> perfectly, and jythonconsole does not yet adequately fulfill my needs for an
> editing environment.
> For now, I'd just be happy to have the inspect module working. The
> developer of jythonconsole says that he uses inspect.py in his
> implementation, but whenever i'm using jython and I try to import it, I
> always get an error message saying that the module cannot be found. When I'm
> in python, however, I'm able to import it just fine.
> If anyone has any advice as to how I could troubleshoot this, I would
> greatly appreciate it if you would let me know. Thanks.
> On 8/21/07, Pekka Laukkanen <peke@...> wrote:
> > 2007/8/21, Jake B < otakuj462@...>:
> > > I was wondering if there
> > > were any other function that could retrieve an object's public methods
> > and
> > > other constructs.
> > You probably already know about it but simply using dir(object) gives
> > you list of all the object's attributes. If you are only interested
> > about methods, relatively simple code like below can help.
> > >>> from java.lang import String
> > >>> from types import MethodType
> > >>> s = String('')
> > >>> for a in [a for a in dir(s) if type(getattr(s, a)) is MethodType ]:
> > ... print a
> > Cheers,
> > .peke