Search found 2 matches
- Wed Jan 29, 2020 4:30 am
- Forum: Development of MicroPython
- Topic: How to invoke own method from C?
- Replies: 5
- Views: 4240
Re: How to invoke own method from C?
Thanks, I have adjusted that code a little because it's in an external C module: mp_obj_t dest[3]; mp_fun_table.load_method(self, MP_QSTR_write, dest); dest[2] = b; mp_fun_table.call_method_n_kw(1, 0, dest); At run time though it does not find the write method that is in the subclass Dumper : Attrib...
- Mon Jan 27, 2020 6:13 pm
- Forum: Development of MicroPython
- Topic: How to invoke own method from C?
- Replies: 5
- Views: 4240
How to invoke own method from C?
I am porting some code that is structured like this: class stem: def flush(self): self.write(self, <blah>) class Dumper(stem): def write(self, bb): print("---> WRITE called", bb) That is Dumper inherits from stem , while stem.flush() calls method write . What I am trying to do is implement class ste...