Skip to content

Adding type hints #3107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 69 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
7aa6898
Added type hints to analogio
evaherrada Jul 2, 2020
6fd6747
Added type hints for analogio
evaherrada Jul 2, 2020
cb259de
Did busio, fixed up analogio
evaherrada Jul 2, 2020
596f2f6
Merge branch 'type_hints' of https://github.com/dherrada/circuitpytho…
evaherrada Jul 2, 2020
d1664bd
Fixed extract_pyi script to allow NoneType
evaherrada Jul 2, 2020
1e96ca5
Made more modifications to extract_pyi.py
evaherrada Jul 2, 2020
627ecad
Did aesio
evaherrada Jul 2, 2020
427733a
More tweaks to extract_pyi.py
evaherrada Jul 2, 2020
2681bd5
Did audiobusio
evaherrada Jul 2, 2020
b26ee6c
Added type hints to audiocore
evaherrada Jul 2, 2020
3d1e005
Added type hints to audioio
evaherrada Jul 2, 2020
24bca06
Added type hints to audiomixer
evaherrada Jul 2, 2020
e114b31
Added type hints to audiomp3
evaherrada Jul 2, 2020
e169da3
More extract_pyi tweaks
evaherrada Jul 2, 2020
ed476a4
Added type hints to audiopwmio
evaherrada Jul 2, 2020
ffc5f0c
Added type hints to bitbangio
evaherrada Jul 2, 2020
ac113fd
Changed bytearray to a union
evaherrada Jul 2, 2020
522b17c
Made suggested changes
evaherrada Jul 2, 2020
54cb1fe
Removed all 'self, )'
evaherrada Jul 2, 2020
26f1fd0
Added type hints to _bleio
evaherrada Jul 2, 2020
51fd286
Added type hints to board
evaherrada Jul 2, 2020
dd27fdf
Added type hints to countio
evaherrada Jul 2, 2020
9b4ffc0
Changed unions to ReadableBuffer and WriteableBuffer
evaherrada Jul 2, 2020
783cc4d
Added type hints to displayio
evaherrada Jul 3, 2020
48ea227
Added type hints to fontio
evaherrada Jul 3, 2020
ca0e8ea
Added type hints to framebufferio
evaherrada Jul 3, 2020
5184144
Added type hints to frequencyio
evaherrada Jul 3, 2020
ff8604b
Added type hints to gamepad
evaherrada Jul 3, 2020
d73348f
Added type hints to gamepadshift
evaherrada Jul 3, 2020
6a3968d
Added type hints to gnss
evaherrada Jul 3, 2020
2e8b8c7
Added type hints to i2cperipheral
evaherrada Jul 3, 2020
0a8d9ee
Added type hints to microcontroller
evaherrada Jul 3, 2020
0abf45a
Added type hints to nvm
evaherrada Jul 3, 2020
e273b9a
Added type hints to _pew
evaherrada Jul 3, 2020
41f12a7
Added type hints to pixelbuf
evaherrada Jul 3, 2020
a2c7e27
Added type hints to ps2io
evaherrada Jul 3, 2020
93d2007
Added type hints to pulseio
evaherrada Jul 3, 2020
c8437e6
Added type hints to rgbmatrix
evaherrada Jul 3, 2020
d9a98bd
Added type hints to rotaryio
evaherrada Jul 3, 2020
48443ce
Added type hints to sdcardio
evaherrada Jul 3, 2020
71ec419
Added type hints to sdioio
evaherrada Jul 3, 2020
9116470
Added type hints to socket
evaherrada Jul 3, 2020
6e4c76a
Added type hints to _stage
evaherrada Jul 3, 2020
f822937
Added type hints to terminalio
evaherrada Jul 3, 2020
0a65709
Added type hints to touchio
evaherrada Jul 3, 2020
e089862
Added type hints to usb_hid
evaherrada Jul 3, 2020
9c842c5
Added type hints to usb_midi
evaherrada Jul 3, 2020
5163618
Added type hints to watchdog
evaherrada Jul 3, 2020
843ff5d
Added type hints to wiznet
evaherrada Jul 3, 2020
3df03a5
Made most of the requested changes
evaherrada Jul 3, 2020
d358c91
Fixed init formatting
evaherrada Jul 3, 2020
d0d949c
Made every init return None
evaherrada Jul 3, 2020
f56deb6
Added type hints to _eve
evaherrada Jul 3, 2020
591cc1a
Added type hints to math
evaherrada Jul 3, 2020
9122d0b
Added type hints to multiterminal
evaherrada Jul 3, 2020
aaa550b
Added type hints to network
evaherrada Jul 3, 2020
e237dfe
Added type hints to os
evaherrada Jul 3, 2020
97d405e
Added type hints to random
evaherrada Jul 3, 2020
a88004e
Added type hints to rtc
evaherrada Jul 3, 2020
45b6e01
Added type hints to storage
evaherrada Jul 3, 2020
4758081
Added type hints to struct
evaherrada Jul 3, 2020
4c5a9d1
Added type hints to time
evaherrada Jul 3, 2020
657c651
Added type hints to uheap
evaherrada Jul 3, 2020
9911b64
Added type hints to ustack
evaherrada Jul 3, 2020
bce77ad
Added type hints previously missed
evaherrada Jul 3, 2020
bfcaa4b
Made requested changes in displayio
evaherrada Jul 16, 2020
d64b4e3
Made more requested changes
evaherrada Jul 17, 2020
612c6bb
Merge branch 'main' into type_hints
evaherrada Jul 17, 2020
9e3fa86
Merge branch 'main' into type_hints
evaherrada Jul 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shared-bindings/analogio/AnalogIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) {
raise_deinited_error();
}
}
//| def __enter__(self, ) -> None:
//| def __enter__(self, ) -> AnalogIn:
//| """No-op used by Context Managers."""
//| ...
//|
Expand Down
2 changes: 1 addition & 1 deletion shared-bindings/analogio/AnalogOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit);

//| def __enter__(self, ) -> None:
//| def __enter__(self, ) -> AnalogOut:
//| """No-op used by Context Managers."""
//| ...
//|
Expand Down
18 changes: 9 additions & 9 deletions shared-bindings/busio/I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con
return (mp_obj_t)self;
}

//| def deinit(self, ) -> Any:
//| def deinit(self, ) -> None:
//| """Releases control of the underlying hardware so other classes can use it."""
//| ...
//|
Expand All @@ -100,13 +100,13 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) {
}
}

//| def __enter__(self, ) -> Any:
//| def __enter__(self, ) -> I2C:
//| """No-op used in Context Managers."""
//| ...
//|
// Provided by context manager helper.

//| def __exit__(self, ) -> Any:
//| def __exit__(self, ) -> None:
//| """Automatically deinitializes the hardware on context exit. See
//| :ref:`lifetime-and-contextmanagers` for more info."""
//| ...
Expand All @@ -125,7 +125,7 @@ static void check_lock(busio_i2c_obj_t *self) {
}
}

//| def scan(self, ) -> Any:
//| def scan(self, ) -> list:
//|
//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a
//| list of those that respond.
Expand All @@ -150,7 +150,7 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan);

//| def try_lock(self, ) -> Any:
//| def try_lock(self, ) -> bool:
//| """Attempts to grab the I2C lock. Returns True on success.
//|
//| :return: True when lock has been grabbed
Expand All @@ -164,7 +164,7 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock);

//| def unlock(self, ) -> Any:
//| def unlock(self, ) -> none:
//| """Releases the I2C lock."""
//| ...
//|
Expand All @@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock);

//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any:
//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> None:
//| """Read into ``buffer`` from the device selected by ``address``.
//| The number of bytes read will be the length of ``buffer``.
//| At least one byte must be read.
Expand Down Expand Up @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args,
}
MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into);

//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any:
//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> None:
//| """Write the bytes from ``buffer`` to the device selected by ``address``.
//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be
//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and
Expand Down Expand Up @@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);

//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any:
//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
//| ``in_buffer`` can be the same buffer because they are used sequentially.
Expand Down
12 changes: 6 additions & 6 deletions shared-bindings/busio/OneWire.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args,
return MP_OBJ_FROM_PTR(self);
}

//| def deinit(self, ) -> Any:
//| def deinit(self, ) -> None:
//| """Deinitialize the OneWire bus and release any hardware resources for reuse."""
//| ...
//|
Expand All @@ -94,13 +94,13 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) {
}
}

//| def __enter__(self, ) -> Any:
//| def __enter__(self, ) -> OneWire:
//| """No-op used by Context Managers."""
//| ...
//|
// Provided by context manager helper.

//| def __exit__(self, ) -> Any:
//| def __exit__(self, ) -> None:
//| """Automatically deinitializes the hardware when exiting a context. See
//| :ref:`lifetime-and-contextmanagers` for more info."""
//| ...
Expand All @@ -112,7 +112,7 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args)
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__);

//| def reset(self, ) -> Any:
//| def reset(self, ) -> bool:
//| """Reset the OneWire bus and read presence
//|
//| :returns: False when at least one device is present
Expand All @@ -127,7 +127,7 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset);

//| def read_bit(self, ) -> Any:
//| def read_bit(self, ) -> bool:
//| """Read in a bit
//|
//| :returns: bit state read
Expand All @@ -142,7 +142,7 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit);

//| def write_bit(self, value: Any) -> Any:
//| def write_bit(self, value: bool) -> None:
//| """Write out a bit based on value."""
//| ...
//|
Expand Down
20 changes: 10 additions & 10 deletions shared-bindings/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con
return MP_OBJ_FROM_PTR(self);
}

//| def deinit(self, ) -> Any:
//| def deinit(self, ) -> None:
//| """Turn off the SPI bus."""
//| ...
//|
Expand All @@ -111,13 +111,13 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit);

//| def __enter__(self, ) -> Any:
//| def __enter__(self, ) -> SPI:
//| """No-op used by Context Managers.
//| Provided by context manager helper."""
//| ...
//|

//| def __exit__(self, ) -> Any:
//| def __exit__(self, ) -> None:
//| """Automatically deinitializes the hardware when exiting a context. See
//| :ref:`lifetime-and-contextmanagers` for more info."""
//| ...
Expand All @@ -142,7 +142,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) {
}
}

//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any:
//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> None:
//| """Configures the SPI bus. The SPI object must be locked.
//|
//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower
Expand Down Expand Up @@ -201,7 +201,7 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_
}
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure);

//| def try_lock(self, ) -> Any:
//| def try_lock(self, ) -> bool:
//| """Attempts to grab the SPI lock. Returns True on success.
//|
//| :return: True when lock has been grabbed
Expand All @@ -215,7 +215,7 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock);

//| def unlock(self, ) -> Any:
//| def unlock(self, ) -> None:
//| """Releases the SPI lock."""
//| ...
//|
Expand All @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock);

//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any:
//| def write(self, buffer: bytes, *, start: int = 0, end: int = None) -> None:
//| """Write the data contained in ``buffer``. The SPI object must be locked.
//| If the buffer is empty, nothing happens.
//|
Expand Down Expand Up @@ -270,7 +270,7 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write);


//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any:
//| def readinto(self, buffer: bytearray, *, start: int = 0, end: int = None, write_value: int = 0) -> None:
//| """Read into ``buffer`` while writing ``write_value`` for each byte read.
//| The SPI object must be locked.
//| If the number of bytes to read is 0, nothing happens.
Expand Down Expand Up @@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m
}
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto);

//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any:
//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: None = 0, in_end: int = None) -> None:
//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``.
//| The SPI object must be locked.
//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]``
Expand Down Expand Up @@ -377,7 +377,7 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args
}
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto);

//| frequency: Any = ...
//| frequency: int = ...
//| """The actual SPI bus frequency. This may not match the frequency requested
//| due to internal limitations."""
//|
Expand Down
29 changes: 15 additions & 14 deletions shared-bindings/busio/UART.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co
return (mp_obj_t)self;
}

//| def deinit(self, ) -> Any:
//| def deinit(self, ) -> None:
//| """Deinitialises the UART and releases any hardware resources for reuse."""
//| ...
//|
Expand All @@ -159,13 +159,13 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) {
}
}

//| def __enter__(self, ) -> Any:
//| def __enter__(self, ) -> UART:
//| """No-op used by Context Managers."""
//| ...
//|
// Provided by context manager helper.

//| def __exit__(self, ) -> Any:
//| def __exit__(self, ) -> None:
//| """Automatically deinitializes the hardware when exiting a context. See
//| :ref:`lifetime-and-contextmanagers` for more info."""
//| ...
Expand All @@ -179,7 +179,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_

// These are standard stream methods. Code is in py/stream.c.
//
//| def read(self, nbytes: Any = None) -> Any:
//| def read(self, nbytes: int = None) -> Optional[bytes]:
//| """Read characters. If ``nbytes`` is specified then read at most that many
//| bytes. Otherwise, read everything that arrives until the connection
//| times out. Providing the number of bytes expected is highly recommended
Expand All @@ -190,7 +190,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_
//| ...
//|

//| def readinto(self, buf: Any) -> Any:
//| def readinto(self, buf: bytes) -> Optional[int]:
//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes.
//|
//| :return: number of bytes read and stored into ``buf``
Expand All @@ -200,15 +200,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_
//| ...
//|

//| def readline(self, ) -> Any:
//| def readline(self, ) -> Optional[int]:
//| """Read a line, ending in a newline character.
//|
//| :return: the line read
//| :rtype: int or None"""
//| ...
//|

//| def write(self, buf: Any) -> Any:
//| def write(self, buf: bytearray) -> Optional[int]:
//| """Write the buffer of bytes to the bus.
//|
//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string.
Expand Down Expand Up @@ -261,7 +261,7 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t
return ret;
}

//| baudrate: Any = ...
//| baudrate: int = ...
//| """The current baudrate."""
//|
STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) {
Expand All @@ -287,7 +287,7 @@ const mp_obj_property_t busio_uart_baudrate_obj = {
(mp_obj_t)&mp_const_none_obj},
};

//| in_waiting: Any = ...
//| in_waiting: int = ...
//| """The number of bytes in the input buffer, available to be read"""
//|
STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) {
Expand All @@ -304,7 +304,7 @@ const mp_obj_property_t busio_uart_in_waiting_obj = {
(mp_obj_t)&mp_const_none_obj},
};

//| timeout: Any = ...
//| timeout: float = ...
//| """The current timeout, in seconds (float)."""
//|
STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) {
Expand Down Expand Up @@ -332,8 +332,9 @@ const mp_obj_property_t busio_uart_timeout_obj = {
(mp_obj_t)&mp_const_none_obj},
};

//| def reset_input_buffer(self, ) -> Any: ...
//| """Discard any unread characters in the input buffer."""
//| def reset_input_buffer(self, ) -> None:
//| """Discard any unread characters in the input buffer."""
//| ...
//|
STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) {
busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);
Expand All @@ -346,10 +347,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_o
//| class Parity:
//| """Enum-like class to define the parity used to verify correct data transfer."""
//|
//| ODD: Any = ...
//| ODD: int = ...
//| """Total number of ones should be odd."""
//|
//| EVEN: Any = ...
//| EVEN: int = ...
//| """Total number of ones should be even."""
//|
const mp_obj_type_t busio_uart_parity_type;
Expand Down
10 changes: 8 additions & 2 deletions tools/extract_pyi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Run with 'python tools/extract_pyi.py shared-bindings/ path/to/stub/dir
# You can also test a specific library in shared-bindings by putting the path
# to that directory instead

import os
import sys
import astroid
Expand Down Expand Up @@ -58,8 +62,10 @@ def convert_folder(top_level, stub_directory):
print(i.__dict__['name'])
for j in i.body:
if isinstance(j, astroid.scoped_nodes.FunctionDef):
if None in j.args.__dict__['annotations']:
print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
for i in j.args.__dict__['annotations']:
if type(i) == astroid.node_classes.Name:
if i.name == 'Any':
print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
if j.returns:
if 'Any' in j.returns.__dict__.values():
print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}")
Expand Down