From 8ae103e07ce2332918340463f419f7aad6528c55 Mon Sep 17 00:00:00 2001 From: Dale Hawkins Date: Mon, 16 Mar 2020 09:07:10 -0600 Subject: Fix documentation typo: tm_minute should be tm_min --- shared-bindings/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared-bindings') diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 8d7f2f3fd..aa2f4fc6a 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -107,7 +107,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp //| * ``tm_month``: the month, range [1, 12] //| * ``tm_mday``: the day of the month, range [1, 31] //| * ``tm_hour``: the hour, range [0, 23] -//| * ``tm_minute``: the minute, range [0, 59] +//| * ``tm_min``: the minute, range [0, 59] //| * ``tm_sec``: the second, range [0, 61] //| * ``tm_wday``: the day of the week, range [0, 6], Monday is 0 //| * ``tm_yday``: the day of the year, range [1, 366], -1 indicates not known -- cgit v1.2.3 From f572b723060382bbc9ca7a3edc88cb7c30fdcc30 Mon Sep 17 00:00:00 2001 From: AndrewR-L <59139513+AndrewR-L@users.noreply.github.com> Date: Fri, 17 Apr 2020 15:10:36 +0100 Subject: busio/UART: Correct and clarify readline() return. Surely readline() "rtype" is string not int as stated (and not bytes as some might expect). Also it is not totally unambiguous what happens on a timeout so it would help to clarify in docs that on a timeout it does NOT return with what it has read so far, rather it leaves all that in the buffer ready for a future read and returns nothing. Likewise clarify that if timeout=0 but there is no newline it DOES return what it has read so far (NOT None). At least this is what I think it does and/or is supposed to do! Python docs are generally not too explicit about what is the proper treatment, so perhaps all the more reason to clarify the interpretation adopted? --- shared-bindings/busio/UART.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'shared-bindings') diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 02c5afb16..e4a6b93d9 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -201,13 +201,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| :rtype: int or None (on a non-blocking error) //| //| *New in CircuitPython 4.0:* No length parameter is permitted. - +//| //| .. method:: readline() //| -//| Read a line, ending in a newline character. +//| Read a line, ending in a newline character, or +//| return None if a timeout occurs sooner, or +//| return everything readable if no newline is found and timeout=0 //| //| :return: the line read -//| :rtype: int or None +//| :rtype: str or None //| //| .. method:: write(buf) //| -- cgit v1.2.3 From 70fdde4aaaa6c1c8fd54c0463d405dfbf8794b10 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Jul 2020 15:11:40 -0700 Subject: Remove trailing space --- shared-bindings/busio/UART.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared-bindings') diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 25cf5f480..a9619a8e0 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -202,7 +202,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| def readline(self, ) -> Any: //| """Read a line, ending in a newline character, or //| return None if a timeout occurs sooner, or -//| return everything readable if no newline is found and timeout=0 +//| return everything readable if no newline is found and timeout=0 //| //| :return: the line read //| :rtype: bytes or None""" -- cgit v1.2.3