Have you tried this? It may be what you're looking for:

isinstance(value, Class)

On Tue, Mar 9, 2010 at 9:55 AM, Thanos Tsounis <ttsounis@sciops.esa.int> wrote:
Hi,

I have been asked to maintain some java code that was developed on top of Jython 2.1. When testing existing code against Jython 2.5.1 I've noticed that the PyJavaClass class is no longer present in the Jython API and therefore get a compilation error. Has it been replaced with another class? I tried to find one but with no success. More explicitly, I would like to check if an object in the jython name space is a representation of a Java class object. Consider the following code:

public static final Condition IS_CLASS = new Condition() {
    public boolean satisfy(String key, Object value) {
        return value instanceof PyJavaClass || value instanceof PyClass;
    }
};


Is there an easy way to obtain the same behaviout with Jython 2.5.1? I would also like to know how to get the name of a java class wrapped by a PyObject (if of course the PyObject represents a java class object). Thanks!

Kind regards,
Thanos Tsounis
-- 
Thanos Tsounis
European Space Astronomy Centre (ESAC)
Research and Scientific Support Department
Herschel Science Centre - Data Processing
P.O. Box 78
28691 Villanueva de la Caņada
Madrid
Spain

mailto:thanos.tsounis@sciops.esa.int
http://herschel.esac.esa.int
phone: +34 918131 178 
================================================================================================
This message and any attachments are intended for the use of the addressee or addressees only.

The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is prohibited.

If you received this message in error, please delete it from your system and notify the sender.

E-mails can be altered and their integrity cannot be guaranteed.

ESA shall not be liable for any e-mail if modified.
=================================================================================================

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users