summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-11-02 18:16:32 -0800
committerGitHub <noreply@github.com>2020-11-02 18:16:32 -0800
commit9bf77905e34b90e4a14f8f7984da441decc47904 (patch)
tree8417ae7e330f189c75d551eff541beb85f23d934 /shared-bindings
parent73582c9cebd347a1bec63bd11e8018d3301810de (diff)
parent88fcf4ef7e001e547ed94747df5d22b6736c881c (diff)
Merge pull request #3622 from sw23/main
Fixing remaining stub mypy issues + run check-stubs to CI
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/ipaddress/IPv4Address.c2
-rw-r--r--shared-bindings/socket/__init__.c15
-rw-r--r--shared-bindings/socketpool/SocketPool.c11
3 files changed, 18 insertions, 10 deletions
diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c
index b2a10158a..e027f32d6 100644
--- a/shared-bindings/ipaddress/IPv4Address.c
+++ b/shared-bindings/ipaddress/IPv4Address.c
@@ -126,7 +126,7 @@ const mp_obj_property_t ipaddress_ipv4address_version_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| def __eq__(self, other: IPv4Address) -> bool:
+//| def __eq__(self, other: object) -> bool:
//| """Two Address objects are equal if their addresses and address types are equal."""
//| ...
//|
diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c
index 38840da5e..799bf28af 100644
--- a/shared-bindings/socket/__init__.c
+++ b/shared-bindings/socket/__init__.c
@@ -49,7 +49,14 @@ STATIC const mp_obj_type_t socket_type;
//| class socket:
//|
-//| def __init__(self, family: int, type: int, proto: int) -> None:
+//| AF_INET: int
+//| AF_INET6: int
+//| SOCK_STREAM: int
+//| SOCK_DGRAM: int
+//| SOCK_RAW: int
+//| IPPROTO_TCP: int
+//|
+//| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None:
//| """Create a new socket
//|
//| :param int family: AF_INET or AF_INET6
@@ -57,12 +64,6 @@ STATIC const mp_obj_type_t socket_type;
//| :param int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)"""
//| ...
//|
-//| AF_INET: int
-//| AF_INET6: int
-//| SOCK_STREAM: int
-//| SOCK_DGRAM: int
-//| SOCK_RAW: int
-//|
STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 0, 4, false);
diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c
index b737b5fc2..73eeed265 100644
--- a/shared-bindings/socketpool/SocketPool.c
+++ b/shared-bindings/socketpool/SocketPool.c
@@ -57,8 +57,14 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t
return MP_OBJ_FROM_PTR(s);
}
-
-//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None:
+//| AF_INET: int
+//| AF_INET6: int
+//| SOCK_STREAM: int
+//| SOCK_DGRAM: int
+//| SOCK_RAW: int
+//| IPPROTO_TCP: int
+//|
+//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket:
//| """Create a new socket
//|
//| :param ~int family: AF_INET or AF_INET6
@@ -66,6 +72,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t
//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)"""
//| ...
//|
+
STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 0, 5, false);