super() fails with error: TypeError “argument 1 must be type, not classobj” when parent does not inherit from object

I get some error that I can’t figure out. Any clue what is wrong with my sample code? class B: def meth(self, arg): print arg class C(B): def meth(self, arg): super(C, self).meth(arg) print C().meth(1) I got the sample test code from help of ‘super’ built-in method. Here is the error: Traceback (most recent call last): … Read more

Maven project version inheritance – do I have to specify the parent version?

I have two projects: Parent project: A, Sub project: B A/pom.xml: <groupId>com.dummy.bla</groupId> <artifactId>parent</artifactId> <version>0.1-SNAPSHOT</version> <packaging>pom</packaging> And in B/pom.xml, I have: <parent> <groupId>com.dummy.bla</groupId> <artifactId>parent</artifactId> <version>0.1-SNAPSHOT</version> </parent> <groupId>com.dummy.bla.sub</groupId> <artifactId>kid</artifactId> I want B to inherit the version from parent, so the only place in my case I need to put 0.1-SNAPSHOT is A/pom.xml. But if i remove the … Read more

Why is it not possible to extend annotations in Java?

I don’t understand why there is no inheritance in Java annotations, just as Java classes. I think it would be very useful. For example: I want to know if a given annotation is a validator. With inheritance, I could reflexively navigate through superclasses to know if this annotation extends a ValidatorAnnotation. Otherwise, how can I … Read more