Search found 68 matches

by hlovatt
Mon Aug 03, 2020 11:19 am
Forum: General Discussion and Questions
Topic: uarray.array methods
Replies: 9
Views: 4331

Re: uarray.array methods

To document what the class does (subset of Python array.array) and also for a type shed for IDEs so they know what the class can do.
by hlovatt
Mon Aug 03, 2020 7:25 am
Forum: General Discussion and Questions
Topic: uarray.array methods
Replies: 9
Views: 4331

Re: uarray.array methods

Thanks. I guess my best bet is to add the dunder (magic) methods and in the documentation and note that the actual method isn't present and hence can't be directly called but the builtins do work. EG for `uarray.array`: def __getitem__(self, index: int) -> Any: """ Returns the item at the given inde...
by hlovatt
Mon Aug 03, 2020 5:46 am
Forum: General Discussion and Questions
Topic: uarray.array methods
Replies: 9
Views: 4331

Re: uarray.array methods

More:
  1. `__add__` not present, but `a + a` works.
  2. `__iadd__` not present, but `a += a` works.
  3. `__repr__` not present, but `str(a)` and `repr(a)` both work.
by hlovatt
Mon Aug 03, 2020 5:11 am
Forum: General Discussion and Questions
Topic: uarray.array methods
Replies: 9
Views: 4331

Re: uarray.array methods

Also `__len__` is missing but `len(a)` works!
by hlovatt
Mon Aug 03, 2020 4:22 am
Forum: General Discussion and Questions
Topic: uarray.array methods
Replies: 9
Views: 4331

Re: uarray.array methods

Playing with this in the REPL I have noticed some anomalies (where `a` is a `uarray.array`): `a[0]` works but `a.__getitem__(0)` doesn't (it works in Python). Similarly `a.__setitem__(0, x)`. CPython's `array.array` doesn't have `decode`, instead it has `tobytes`. So: How can the indexing by documen...
by hlovatt
Mon Aug 03, 2020 12:58 am
Forum: General Discussion and Questions
Topic: uarray.array methods
Replies: 9
Views: 4331

uarray.array methods

Hi, The documentation for `uarray.array` lists methods `append` and `extend`, however: `dir(uarray.array)` gives: `['__class__', '__name__', 'append', 'extend', '__bases__', '__dict__', 'decode']`, what's `decode` (it appears to convert to a str - presumably same a `bytes` method of same name)? Set ...
by hlovatt
Sat Jul 25, 2020 4:31 am
Forum: Development of MicroPython
Topic: Typesheds
Replies: 15
Views: 9260

Typesheds

Hi all, Is there an interest in adding typesheds (type hint interfaces) to MicroPython to help IDEs that understand types and/or show documentation: PyCharm, VSCode, etc.? So far I have generated `pyb.pyi` and `uarray.pyi`, the files are at https://github.com/hlovatt/PyBoardTypeshed and the code use...
by hlovatt
Sat Jul 25, 2020 4:05 am
Forum: General Discussion and Questions
Topic: Season of Docs : MicroPython
Replies: 23
Views: 13937

Re: Season of Docs : MicroPython

I have generated a couple of typesheds (type hint interfaces): `pyb.pyi` and `uarray.pyi`. The files are at https://github.com/hlovatt/PyBoardTypeshed and the code used to generate them is at https://github.com/hlovatt/PyBoardTypeshedGenerator . These are helpful for IDEs that understand types and/o...
by hlovatt
Fri Jul 03, 2020 6:11 am
Forum: Development of MicroPython
Topic: Anyone know what BRK_OFF etc. in Timer do?
Replies: 3
Views: 2156

Re: Anyone know what BRK_OFF etc. in Timer do?

Thanks, have submitted a pull request.
by hlovatt
Fri Jul 03, 2020 5:50 am
Forum: Development of MicroPython
Topic: Does Pyboard D support UART flow control?
Replies: 2
Views: 1721

Does Pyboard D support UART flow control?

Hi,

Does Pyboard D support UART flow control?, It doesn't say anything in the documentation!

Cheers,

Howard.