From: <bc...@wo...> - 2001-09-12 18:33:41
|
[Sebastien Pierre] >Hi all, > >I get a "read-only attribute" error when I try to assign a value to an >inherited protected attribute. There is no support at all for direct access to protected fields. >The FAQ talks about protected static >fields, which is not the case. Is there any turnaround? You could perhaps: - Add a java setter method. - play with the respectJavaAccessibility registry setting. >BTW, I was wondering how to access the ".class" attribute of any Object >in Java from Jython, >>> import java >>> d = java.util.Date() >>> d.__class__ <jclass java.util.Date at 2751722> >>> or just use java.util.Date class directly. >and how to do an "instanceof" instruction in Jython. >>> if isinstance(d, java.util.Date): print "got a date!" ... got a date! regards, finn |