Search found 54 matches

by tuupola
Sat Sep 07, 2019 8:43 am
Forum: Development of MicroPython
Topic: C module programming reference
Replies: 19
Views: 11350

Re: C module programming reference

This is excellent work. Thank you!
by tuupola
Wed May 01, 2019 5:41 am
Forum: Programs, Libraries and Tools
Topic: RFD77402
Replies: 3
Views: 2704

Re: RFD77402

I also personally also like to follow some parts of Circuit Python design guide. Especially the naming the sensor properties and units part.
by tuupola
Wed Apr 17, 2019 1:38 pm
Forum: General Discussion and Questions
Topic: Extend System Module By Subclassing
Replies: 8
Views: 5529

Re: Extend System Module By Subclassing

Tested with real device and works for me with ESP32. Note that __getattr__ is called only when accessing an undefined attribute. Here is a bit cleaned up code: import network class wlan: def __init__(self, mode): self._station = network.WLAN(mode) self._station.active(True) def __getattr__(self, nam...
by tuupola
Wed Apr 17, 2019 7:57 am
Forum: General Discussion and Questions
Topic: Extend System Module By Subclassing
Replies: 8
Views: 5529

Re: Extend a Module By Subclassing

Hmm. interesting was not aware of the composition approach, but I guess that custom() will not contain all of the original methods and variables from WLAN() in your example, and that I would need to redefine / link them all if required ? You can use __getattr__ magic. It should work for both attrib...
by tuupola
Tue Apr 16, 2019 1:33 pm
Forum: General Discussion and Questions
Topic: Extend System Module By Subclassing
Replies: 8
Views: 5529

Re: Extend a Module By Subclassing

You could use composition instead of inheritance. Personally I always prefer composition. class wlan: def __init__(self, station): self._station = station def scan(self): print('replace original scanning method') return self._station.scan() def xscan(self): print('new scan method using sub method') ...
by tuupola
Sun Apr 14, 2019 6:53 am
Forum: ESP32 boards
Topic: Integrating Loboris port back to official uP ESP32 port
Replies: 33
Views: 26390

Re: Integrating Loboris port back to official uP ESP32 port

kevinkk525 wrote:
Wed Apr 10, 2019 10:32 am
I agree, the display module would be perfect for a standalone module with the upcoming c-file support.
This sounds interesting. Is there any more information about c-file support somehere?
by tuupola
Sun Apr 14, 2019 6:52 am
Forum: ESP32 boards
Topic: Integrating Loboris port back to official uP ESP32 port
Replies: 33
Views: 26390

Re: Integrating Loboris port back to official uP ESP32 port

FWIW I use Loboris fork for my M5Stack based projects and I love it. However most of the new features, like the display module IMO do not belong to Micropython core. Core should stay lean. They should be able to easily be added to custom build though. The main reason for me to use Loboris fork was p...
by tuupola
Sun Apr 14, 2019 5:04 am
Forum: General Discussion and Questions
Topic: Other Micropython forums
Replies: 3
Views: 2743

Re: Other Micropython forums

Maybe not high traffic, but this forum has a good signal to noise ratio.
by tuupola
Wed Mar 28, 2018 3:16 pm
Forum: General Discussion and Questions
Topic: Frozen modules and search order
Replies: 7
Views: 7785

Re: Frozen modules and search order

Awesome. Thanks!
by tuupola
Fri Mar 02, 2018 10:48 am
Forum: General Discussion and Questions
Topic: Frozen modules and search order
Replies: 7
Views: 7785

Frozen modules and search order

Do i understand correctly frozen modules are always the first in the search order when doing an import? For example let's assume I have a frozen module called foo. I made some changes to it and would like to test the changes so I upload foo.py to the flash. However when I do import foo it always see...