|
From: Robert W. B. <rb...@di...> - 2001-01-08 23:55:47
|
[Adam Burke] > You are very much on the right track. > > This is an FAQ: <snip> > > If you want to leave respectJavaAccessibility = true, could you inherit > from java.util.Calendar and expose the functionality that way? It may > require adding a public method that simply does > return self.x() Or use the lazy way, avoid the abstract class, and inherit from GregorianCalendar, i.e.- >>>from java.util import GregorianCalendar >>>class myTime(GregorianCalendar): ... def ms(self): ... return self.getTimeInMillis() ... >>>t = test() >>>t.ms() 978997877490L >>> If you still have respectJavaAccessibility = true, you can confirm protected status with: >>>g = GregorianCalendar() >>>g.getTimeInMillis() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: getTimeInMillis (I actually sent this earlier, but received an service unavailable error- I apologize if I'm repeating myself...again :) cheers, -Robert |