Seems like this would do it (note: `in` can't actually be a variable):

class A(HDL):
    # A is now an HDL namespace - all members have signal behavior
    def __init__(self, in, o1, o2):
        self.in = in  # descriptor
        self.o1 = o1 ; self.o2 = o2   # descriptors
    def process(self):
        # is self.in, self.o1 and self.o2 are still descriptor here to be
used?
        # ^  yes, all of those are SignalBehavior descriptors if A is
subclass of HDL ^

class C:
    # depending on behavior desired, C could be HDL namespace, too
    def __init__(self, in, out):
        # these work, but probably are not needed:
        ns.in = 0
        ns.o1 = 0
        ns.o2 = 0
        a = A( ns.in  ,  ns.o1 ,   ns.o2 )
        # ...you can just pass the values to A directly as long as
        # A (or HDL) knows what to do with arbitrary in and out values:
        a = A(in, out,  out)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to