Search found 9 matches
- Mon Dec 09, 2019 5:07 pm
- Forum: General Discussion and Questions
- Topic: How to implement __setattr__ without infinite recursion
- Replies: 14
- Views: 11138
- Sun Dec 08, 2019 11:44 pm
- Forum: General Discussion and Questions
- Topic: How to implement __setattr__ without infinite recursion
- Replies: 14
- Views: 11138
Re: How to implement __setattr__ without infinite recursion
Okay I patched something quick and it seems to work. It's late so I'll tidy it up and open a PR tomorrow. I added an "object.__setattr__" function that basically does "mp_map_lookup(&self->members, attr, MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = value;". The following code now works: class X(object):...
- Sun Dec 08, 2019 11:23 pm
- Forum: General Discussion and Questions
- Topic: How to implement __setattr__ without infinite recursion
- Replies: 14
- Views: 11138
Re: How to implement __setattr__ without infinite recursion
@jimmo These are clever solutions but a naive Python programmer would expect to use object.__setattr__() to break the recursion. Would implementing this be a major problem? Oh yeah, wholeheartedly agree!! Just got distracted by the puzzle, but I have already started doing exactly that (implementing...
- Tue Nov 12, 2019 11:27 pm
- Forum: General Discussion and Questions
- Topic: see code emitted by bytecode, native, viper decorators?
- Replies: 4
- Views: 3121
Re: see code emitted by bytecode, native, viper decorators?
I found this topic after I watched https://www.youtube.com/watch?v=hHec4qL00x0, played around with "dis" in cpython and thought "hey that's quite cool"
Any plans on adding a real "dis"-like module? I don't think it's a long way from the current "mp_bytecode_print" function.
Any plans on adding a real "dis"-like module? I don't think it's a long way from the current "mp_bytecode_print" function.
- Thu Apr 25, 2019 7:50 am
- Forum: General Discussion and Questions
- Topic: Quick code deployment
- Replies: 2
- Views: 1812
Re: Quick code deployment
Cool, looks exactly like what I need.
For future reference, I've found this project which might be useful as well: https://github.com/pycampers/ampy.
For future reference, I've found this project which might be useful as well: https://github.com/pycampers/ampy.
- Tue Apr 23, 2019 5:43 pm
- Forum: General Discussion and Questions
- Topic: Quick code deployment
- Replies: 2
- Views: 1812
Quick code deployment
I'm working on a project that spans across multiple directories and dozens of files. If you work on such a project that is compiled , build systems take care of what's work has to be done after you modify some sources, therefore the recompile process is usually quick, and finally redeploying/flashin...
- Sat Feb 23, 2019 10:10 pm
- Forum: ESP8266 boards
- Topic: Telnet Server
- Replies: 31
- Views: 34617
Re: Telnet Server
The change is simple. According to the hint here https://forum.micropython.org/viewtopic.php?f=8&t=5868&p=33586&hilit=dupterm#p33586 add from uio import IOBase to the import section and change class Telnetserver() into class Telnetserver(IOBase) as shown below in the code snippet: import socket imp...
- Thu Feb 21, 2019 8:00 pm
- Forum: ESP8266 boards
- Topic: Telnet Server
- Replies: 31
- Views: 34617
Re: Telnet Server
Will this telnet server (or any other telnet) work with the standard (official) ESP32 microphython port? [ I've been using the Pycom and the Loboris ports for this feature; both are (more or less) subtly different from standard microphython. ] Bernhard I've tried this now on an ESP32 and it doesn't...
- Tue Feb 05, 2019 9:45 pm
- Forum: General Discussion and Questions
- Topic: How to obtain a list of importable modules?
- Replies: 21
- Views: 41225
Re: How to obtain a list of importable modules?
See my patch in https://github.com/micropython/micropython/pull/4468 for the CPython-compatible solution of this. Note, however, that it includes only modules built into the MicroPython interpreter, and not all "importable" modules, that might be otherwise frozen/located as python/.mpy files in a fi...