On Sat, May 25, 2019 at 11:24 AM Anders Hovmöller <bo...@killingar.net> wrote: > process() in A could look like: > > self.send(output=5) > > To me that looks OK, and scales nicely with multiple outputs: > > self.send(a=5, b=3) > > send() is implemented simply as > > def send(self, **kwargs): > for k, v in kwargs.items(): > signal = self.signals[k] > signal.c_self.output = v
I am sure there are probably a hundred different ways to do this, and all of them may seem nice from a software perspective. But this is really not simpler than existing HDLs which just does signal = 5. One of the reason a lot of people using python is that you can use less chars to represent your ideas precisely, e.g. instead of doing xyz = obj.bar() you can do xyz = obj.bar and making bar as a descriptor, why do we do this at all? because we want to make bar looks like a variable instead of a method and in many cases it present the idea better. So is @ and @=, so is meta class, so is decorators ... and it goes on and on. The intention, is not to have a way to do it, the intention, is to have a equally good way to do it as in traditional HDLs. > > Or something. I'm not sure about the details since I don't understand the > example you give. It's pretty abstract and vague. Just a simple example of > how to use A with a print() and the expected output of said print would help? the example is already to its bare minimum, which part is vague? I can elaborate if you could be more specific. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/