micropython-stubber
micropython-stubber copied to clipboard
merge - add ability to add / some classes & functions
- [x] add new method to Class
- [x] find/extract method in docstubs
- [x] find/extract class in docstubs
- [ ] add new ClassDef to module
machine
- [x]
machine.Pin.__call__ - [x] read method from doc-stubs ( currently hardcoded)
micropython.pyi
- [ ] add decorators from doc stubs
def viper(func:Callable) -> Callable:
"""
The Viper code emitter is not fully compliant. It supports special Viper native data types in pursuit of performance.
Integer processing is non-compliant because it uses machine words: arithmetic on 32 bit hardware is performed modulo 2**32.
Like the Native emitter Viper produces machine instructions but further optimisations are performed, substantially increasing
performance especially for integer arithmetic and bit manipulations.
"""
...
def native(func:Callable) -> Callable:
"""
This causes the MicroPython compiler to emit native CPU opcodes rather than bytecode.
It covers the bulk of the MicroPython functionality, so most functions will require no adaptation.
See: https://docs.micropython.org/en/latest/reference/speed_python.html?highlight=viper#the-native-code-emitter
"""
...
btree.pyi
- [ ] add btree class from docstubs
io.py
Add baseclasses to class
- [ ] IOBase(IO)
- [ ] BufferedWriter(IO)
implementation options:
- ~~using libcts merge ( one of the first merge options did this )~~
- ~~git patch~~
- ✅libcst Codemod