On Thu, Jul 28, 2016 at 15:57:45 -0700, Colin Macdonald wrote:
> This is awesome! I tried this a long time ago but I found I couldn't do
> "subsref" on the static class (I had to instantiate a `py = pyfactory()`
> sort of hack before `py.foo` would call `subsref`).
> I read your code but I don't see the secret? Maybe I tried with a classdef
> style class... or just general incompentence on my part!
Exactly, old-style class vs classdef. I tried both as well until I got
something that worked ;)
I think this is because classdef handle classes can have static methods,
so py.foo would be a method call on the class, but for old-style classes
it's interpreted the same as py().foo.
I thought we might be getting to the point where this would work, and it
turned out to be pretty easy.
> Anyway, its very nice!
I hope it is fun and useful to everyone, and the Python syntax
immediately becomes a lot nicer to deal with.
sys = py.sys ## equivalent to "import sys" in Python
s = sys.stdin.readline ()
Still some interesting differences and problems to work out, help is