Message203

Author bckfnn
Recipients
Date 2000-11-18.19:48:15
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This is an elaboration of bug 263.

With the following Java class

package foobar
public class Super {
  public Super()
  {
    System.out.println("Hi from Super");
  }
}

if you try to run the following Python code:

from foobar import Super
class Sub(Super):
	def __init__(self):
		Super.__init__(self)

It does not work (assuming that the CLASSPATH is set correctly and all), but
emits
the error "TypeError: invalid self argument" at the line that calls
Super.__init__(self).

However, if the Java class Super is in a jar file, then the Python code works.
Also,
if you do not call the superclass constructor explicitly and let the runtime
system
do it, then it works.

This seems very strange to me, since although I can understand why finding
classes
might be different between jar vs. non-jar files (for example, it kind of makes
sense why you can't do "from mypackage import *" unless mypackage is in a jar
file),
I would have thought that once a class was found it would be treated
identically
whether it was in a jar file or not.
History
Date User Action Args
2008-02-20 17:16:45adminlinkissue222877 messages
2008-02-20 17:16:45admincreate