I'm trying to access a class using the direct-import as shown in the pod;
use Inline Python;
my $obj = new Myclass;
__END__
__Python__
from mylibrary import myclass as Myclass
***
The problem seems to be that 'myclass' is declared like so:
from __future__ import generators
import struct
import types
class Dwg(object):
If I remove the inheritance portion "(object)", then it will return an object,
otherwise, I just get "Can't locate object method "new" via package..." (and
a few times got "can't bless non-reference at Inline.pm line 318...", but I
can't manage to repeat that (halucination?))
In a simple test of some directly-Inline python code with inheritance between
two small classes, this doesn't seem to be a problem:
use Inline Python:
my $c = this->new();
print $c->deal();
__END__
__Python__
class Check:
def __init__(self):
print "making new Check";
def deal(self):
return 2;
class this(Check):
def function(self):
return 5;
EOF
This does what you expect it to, so is the problem in the "object" class?
(which then might explain the problem that I'm having with the function
returning a generator later on.)
Thanks,
Eric