8000 Added type hints to analogio · unixjazz/circuitpython@7aa6898 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7aa6898

Browse files
committed
Added type hints to analogio
1 parent 34646c5 commit 7aa6898

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

shared-bindings/analogio/AnalogIn.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type,
7070
return MP_OBJ_FROM_PTR(self);
7171
}
7272

73-
//| def deinit(self, ) -> Any:
73+
//| def deinit(self, ) -> None:
7474
//| """Turn off the AnalogIn and release the pin for other use."""
7575
//| ...
7676
//|
@@ -86,13 +86,13 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) {
8686
raise_deinited_error();
8787
}
8888
}
89-
//| def __enter__(self, ) -> Any:
89+
//| def __enter__(self, ) -> None:
9090
//| """No-op used by Context Managers."""
9191
//| ...
9292
//|
9393
// Provided by context manager helper.
9494

95-
//| def __exit__(self, ) -> Any:
95+
//| def __exit__(self, ) -> None:
9696
//| """Automatically deinitializes the hardware when exiting a context. See
9797
//| :ref:`lifetime-and-contextmanagers` for more info."""
9898
//| ...
@@ -104,7 +104,7 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args)
104104
}
105105
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__);
106106

107-
//| value: Any = ...
107+
//| value: int = ...
108108
//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only)
109109
//|
110110
//| Even if the underlying analog to digital converter (ADC) is lower
@@ -124,7 +124,7 @@ const mp_obj_property_t analogio_analogin_value_obj = {
124124
(mp_obj_t)&mp_const_none_obj},
125125
};
126126

127-
//| reference_voltage: Any = ...
127+
//| reference_voltage: Optional[float] = ...
128128
//| """The maximum voltage measurable (also known as the reference voltage) as a
129129
//| `float` in Volts."""
130130
//|

shared-bindings/analogio/AnalogOut.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t
6666
return MP_OBJ_FROM_PTR(self);
6767
}
6868

69-
//| def deinit(self, ) -> Any:
69+
//| def deinit(self, ) -> None:
7070
//| """Turn off the AnalogOut and release the pin for other use."""
7171
//| ...
7272
//|
@@ -79,13 +79,13 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) {
7979
}
8080
STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit);
8181

82-
//| def __enter__(self, ) -> Any:
82+
//| def __enter__(self, ) -> None:
8383
//| """No-op used by Context Managers."""
8484
//| ...
8585
//|
8686
// Provided by context manager helper.
8787

88-
//| def __exit__(self, ) -> Any:
88+
//| def __exit__(self, ) -> None:
8989
//| """Automatically deinitializes the hardware when exiting a context. See
9090
//| :ref:`lifetime-and-contextmanagers` for more info."""
9191
//| ...
@@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args)
9797
}
9898
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__);
9999

100-
//| value: Any = ...
100+
//| value: None = ...
101101
//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only)
102102
//|
103103
//| Even if the underlying digital to analog converter (DAC) is lower

0 commit comments

Comments
 (0)
0