Python icon indicating copy to clipboard operation
Python copied to clipboard

Ignore missing annotation in __init__ method by algorithms-keeper

Open Cjkjvfnby opened this issue 2 years ago • 0 comments

Feature description

Please provide return type hint for the function: init. If the function does not return a value, please provide the type hint as: def function() -> None:

Adding -> None have not sense, since this is a special method and it always returns None. Aslo this creates noise in code and even decreases readability when it's the reason for extra line breaks.

For example, this line fits without annotation and is split into 3 lines with it.

-    def __init__(self, initial_block_size: int = 8, capacity_factor: float = 0.75) -> None:
+    def __init__(
+        self, initial_block_size: int = 8, capacity_factor: float = 0.75
+    ) -> None:

Cjkjvfnby avatar Nov 06 '22 00:11 Cjkjvfnby