bendudson / py4cl

Call python from Common Lisp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subclassing python classes

digikar99 opened this issue · comments

Either I have forgotten something, or this is missing. Currently, we do not have a method of subclassing python classes, do we?

For instance,

(pyexec "class Foo:
  def __init__(self, x): self.x = x")

Is there a way by which we can achieve the equivalent of (defclass foo-sub (foo) ())?

I think you're right, there's no nice way to do this yet. It should be possible, but I'm not sure how to handle subclassing between python and lisp classes smoothly. It's possible to define a Lisp class whose objects can be passed to python.

Okay, yup, I have this mentioned under TODO - the method I had thought up back then involved MOP - and I do not know MOP. I'll try learning it and give it a try in the next few months when I find the time.