diff --git a/doc/common/extensions/classlink.py b/doc/common/extensions/classlink.py index 96bee0e..3d854a0 100644 --- a/doc/common/extensions/classlink.py +++ b/doc/common/extensions/classlink.py @@ -3,7 +3,6 @@ from docutils.parsers.rst import Directive class PybricksClasslinkDirective(Directive): - required_arguments = 1 optional_arguments = 1 diff --git a/doc/common/extensions/color.py b/doc/common/extensions/color.py index e528562..d2e399b 100644 --- a/doc/common/extensions/color.py +++ b/doc/common/extensions/color.py @@ -5,7 +5,6 @@ from colorsys import hsv_to_rgb class PybricksColorDirective(Directive): - required_arguments = 1 def run(self): diff --git a/doc/common/extensions/versionchanged.py b/doc/common/extensions/versionchanged.py index 3207330..a3b9b15 100644 --- a/doc/common/extensions/versionchanged.py +++ b/doc/common/extensions/versionchanged.py @@ -4,12 +4,12 @@ * deprecated when building documentation with the 'ide' tag. """ + from docutils import nodes from docutils.parsers.rst import Directive class PybricksVersionDirective(Directive): - has_content = True def run(self): diff --git a/examples/ev3/ev3devsensor/class_example.py b/examples/ev3/ev3devsensor/class_example.py index 35c1f27..11525e7 100644 --- a/examples/ev3/ev3devsensor/class_example.py +++ b/examples/ev3/ev3devsensor/class_example.py @@ -23,7 +23,6 @@ class MySensor(Ev3devSensor): # Open the modes file. with open(modes_path, "r") as m: - # Read the contents. contents = m.read() diff --git a/examples/ev3/ps4/main.py b/examples/ev3/ps4/main.py index 578458d..0f5dd44 100644 --- a/examples/ev3/ps4/main.py +++ b/examples/ev3/ps4/main.py @@ -42,13 +42,11 @@ def scale(val, src, dst): while event: - # Place event data into variables (tv_sec, tv_usec, ev_type, code, value) = struct.unpack(FORMAT, event) # If a button was pressed or released if ev_type == 1: - # React to the X button if code == 304 and value == 0: print("The X button was released") @@ -98,7 +96,6 @@ while event: print("The R2 button was pressed") elif ev_type == 3: - # The sticks often trigger non-stop events, comment this out if you are # not using the sticks as part of your project, or it becomes hard to # read other data diff --git a/examples/micropython/system_exit.py b/examples/micropython/system_exit.py index e1bc3df..a88ef7f 100644 --- a/examples/micropython/system_exit.py +++ b/examples/micropython/system_exit.py @@ -3,7 +3,6 @@ from pybricks.tools import wait print("Started!") try: - # Run your script here as you normally would. In this # example we just wait forever and do nothing. while True: diff --git a/examples/pup/hub_common/button_single.py b/examples/pup/hub_common/button_single.py index 5e75f97..c1d9063 100644 --- a/examples/pup/hub_common/button_single.py +++ b/examples/pup/hub_common/button_single.py @@ -12,7 +12,6 @@ hub.system.set_stop_button(None) # Check the button for 5 seconds. watch = StopWatch() while watch.time() < 5000: - # Set light to green if pressed, else red. if hub.buttons.pressed(): hub.light.on(Color.GREEN) diff --git a/examples/pup/hub_common/imu_read_scalar.py b/examples/pup/hub_common/imu_read_scalar.py index ce0b6b4..8d35333 100644 --- a/examples/pup/hub_common/imu_read_scalar.py +++ b/examples/pup/hub_common/imu_read_scalar.py @@ -9,7 +9,6 @@ hub = ThisHub() # Get the acceleration or angular_velocity along a single axis. # If you need only one value, this is more memory efficient. while True: - # Read the forward acceleration. forward_acceleration = hub.imu.acceleration(Axis.X) diff --git a/examples/pup/hub_common/imu_up.py b/examples/pup/hub_common/imu_up.py index 2b55329..8d86fe8 100644 --- a/examples/pup/hub_common/imu_up.py +++ b/examples/pup/hub_common/imu_up.py @@ -18,7 +18,6 @@ SIDE_COLORS = { # Keep updating the color based on detected up side. while True: - # Check which side of the hub is up. up_side = hub.imu.up() diff --git a/examples/pup/hub_common/light_off.py b/examples/pup/hub_common/light_off.py index 6b4ef33..7819f3c 100644 --- a/examples/pup/hub_common/light_off.py +++ b/examples/pup/hub_common/light_off.py @@ -8,7 +8,6 @@ hub = ThisHub() # Turn the light on and off 5 times. for i in range(5): - hub.light.on(Color.RED) wait(1000) diff --git a/examples/pup/hub_common/make_examples.py b/examples/pup/hub_common/make_examples.py index bf4e9e7..fde6840 100755 --- a/examples/pup/hub_common/make_examples.py +++ b/examples/pup/hub_common/make_examples.py @@ -13,9 +13,7 @@ file_paths = [f for f in dir_path.glob("*.py") if f.stem != "make_examples"] # Go through all template scripts for file_path in file_paths: - with open(file_path) as template: - # First line contains hub info hubs = template.readline().strip().split()[3:] @@ -31,9 +29,7 @@ for file_path in file_paths: # Open destination script: with open(gen_path, "w") as dest_file: - # Read script line by line. for line in template.readlines(): - # Replace hub name if present. dest_file.writelines(line.replace("ThisHub", hub)) diff --git a/examples/pup/hub_primehub/button_stop.py b/examples/pup/hub_primehub/button_stop.py index 65f7fc3..aa5d5f4 100644 --- a/examples/pup/hub_primehub/button_stop.py +++ b/examples/pup/hub_primehub/button_stop.py @@ -10,7 +10,6 @@ hub.system.set_stop_button((Button.CENTER, Button.BLUETOOTH)) # Now we can use the center button as a normal button. while True: - # Play a sound if the center button is pressed. if Button.CENTER in hub.buttons.pressed(): hub.speaker.beep() diff --git a/examples/pup/hub_primehub/display_expression.py b/examples/pup/hub_primehub/display_expression.py index 66d8956..81c6d9a 100644 --- a/examples/pup/hub_primehub/display_expression.py +++ b/examples/pup/hub_primehub/display_expression.py @@ -9,7 +9,6 @@ hub = PrimeHub() hub.display.orientation(up=Side.RIGHT) while True: - # Start with random left brow: up or down. if randint(0, 100) < 70: brows = Icon.EYE_LEFT_BROW * 0.5 diff --git a/examples/pup/hub_primehub/display_orientation_imu.py b/examples/pup/hub_primehub/display_orientation_imu.py index be5c81c..d083326 100644 --- a/examples/pup/hub_primehub/display_orientation_imu.py +++ b/examples/pup/hub_primehub/display_orientation_imu.py @@ -6,7 +6,6 @@ from pybricks.tools import wait hub = PrimeHub() while True: - # Check which side of the hub is up. up_side = hub.imu.up() diff --git a/examples/pup/iodevices_pupdevice/port_info.py b/examples/pup/iodevices_pupdevice/port_info.py index fbb437f..d68cb3f 100644 --- a/examples/pup/iodevices_pupdevice/port_info.py +++ b/examples/pup/iodevices_pupdevice/port_info.py @@ -53,7 +53,6 @@ except AttributeError: # Go through all available ports. for port in ports: - # Try to get the device, if it is attached. try: device = PUPDevice(port) diff --git a/examples/pup/motor/motor_absolute.py b/examples/pup/motor/motor_absolute.py index 189af00..594c983 100644 --- a/examples/pup/motor/motor_absolute.py +++ b/examples/pup/motor/motor_absolute.py @@ -6,7 +6,6 @@ from pybricks.tools import wait example_motor = Motor(Port.A) while True: - # Get the default angle value. angle = example_motor.angle() diff --git a/examples/pup/motor/motor_measure.py b/examples/pup/motor/motor_measure.py index e00974a..d2e2895 100644 --- a/examples/pup/motor/motor_measure.py +++ b/examples/pup/motor/motor_measure.py @@ -10,7 +10,6 @@ example_motor.run(300) # Display the angle and speed 50 times. for i in range(100): - # Read the angle (degrees) and speed (degrees per second). angle = example_motor.angle() speed = example_motor.speed() diff --git a/examples/pup/remote/timeout_exception.py b/examples/pup/remote/timeout_exception.py index ed5c187..28510f8 100644 --- a/examples/pup/remote/timeout_exception.py +++ b/examples/pup/remote/timeout_exception.py @@ -9,7 +9,6 @@ try: # Here you can write code that uses the remote. except OSError: - print("Could not find the remote.") # Here you can make your robot do something diff --git a/examples/pup/sensor_color/color_ambient.py b/examples/pup/sensor_color/color_ambient.py index 731982e..ceaa2e5 100644 --- a/examples/pup/sensor_color/color_ambient.py +++ b/examples/pup/sensor_color/color_ambient.py @@ -7,7 +7,6 @@ sensor = ColorSensor(Port.A) # Repeat forever. while True: - # Get the ambient color values. Instead of scanning the color of a surface, # this lets you scan the color of light sources like lamps or screens. hsv = sensor.hsv(surface=False) diff --git a/examples/pup/sensor_color/lights_blink.py b/examples/pup/sensor_color/lights_blink.py index 62ec392..2efa1f6 100644 --- a/examples/pup/sensor_color/lights_blink.py +++ b/examples/pup/sensor_color/lights_blink.py @@ -7,7 +7,6 @@ sensor = ColorSensor(Port.A) # Repeat forever. while True: - # Turn on one light at a time, at half the brightness. # Do this for all 3 lights and repeat that 5 times. for i in range(5): diff --git a/examples/pup/sensor_color/wait_for_color.py b/examples/pup/sensor_color/wait_for_color.py index aa6b58e..53b2513 100644 --- a/examples/pup/sensor_color/wait_for_color.py +++ b/examples/pup/sensor_color/wait_for_color.py @@ -15,7 +15,6 @@ def wait_for_color(desired_color): # Now we use the function we just created above. while True: - # Here you can make your train/vehicle go forward. print("Waiting for red ...") diff --git a/examples/pup/sensor_color_distance/distance_blink.py b/examples/pup/sensor_color_distance/distance_blink.py index ce2f505..e16cae8 100644 --- a/examples/pup/sensor_color_distance/distance_blink.py +++ b/examples/pup/sensor_color_distance/distance_blink.py @@ -7,10 +7,8 @@ sensor = ColorDistanceSensor(Port.A) # Repeat forever. while True: - # If the sensor sees an object nearby. if sensor.distance() <= 40: - # Then blink the light red/blue 5 times. for i in range(5): sensor.light.on(Color.RED) diff --git a/examples/pup/sensor_color_distance/wait_for_color.py b/examples/pup/sensor_color_distance/wait_for_color.py index 04534b4..e52a1d7 100644 --- a/examples/pup/sensor_color_distance/wait_for_color.py +++ b/examples/pup/sensor_color_distance/wait_for_color.py @@ -15,7 +15,6 @@ def wait_for_color(desired_color): # Now we use the function we just created above. while True: - # Here you can make your train/vehicle go forward. print("Waiting for red ...") diff --git a/src/micropython/__init__.py b/src/micropython/__init__.py index d8cee2a..d6819d7 100644 --- a/src/micropython/__init__.py +++ b/src/micropython/__init__.py @@ -13,23 +13,19 @@ from typing import Any, overload @overload -def const(value: int) -> int: - ... +def const(value: int) -> int: ... @overload -def const(value: str) -> str: - ... +def const(value: str) -> str: ... @overload -def const(value: float) -> float: - ... +def const(value: float) -> float: ... @overload -def const(value: tuple) -> tuple: - ... +def const(value: tuple) -> tuple: ... def const(value): @@ -54,13 +50,11 @@ def const(value): @overload -def opt_level() -> int: - ... +def opt_level() -> int: ... @overload -def opt_level(level: int) -> None: - ... +def opt_level(level: int) -> None: ... def opt_level(*args): @@ -90,13 +84,11 @@ def opt_level(*args): @overload -def mem_info() -> None: - ... +def mem_info() -> None: ... @overload -def mem_info(verbose: Any) -> None: - ... +def mem_info(verbose: Any) -> None: ... def mem_info(*args): @@ -113,13 +105,11 @@ def mem_info(*args): @overload -def qstr_info() -> None: - ... +def qstr_info() -> None: ... @overload -def qstr_info(verbose: Any) -> None: - ... +def qstr_info(verbose: Any) -> None: ... def qstr_info(*args): diff --git a/src/pybricks/_common.py b/src/pybricks/_common.py index a2e3380..ec527a5 100644 --- a/src/pybricks/_common.py +++ b/src/pybricks/_common.py @@ -1032,7 +1032,6 @@ class SimpleAccelerometer: class IMU: - def up(self, calibrated: bool = True) -> Side: """up(calibrated=True) -> Side diff --git a/src/pybricks/media/ev3dev.py b/src/pybricks/media/ev3dev.py index 70f33fc..6271cdc 100644 --- a/src/pybricks/media/ev3dev.py +++ b/src/pybricks/media/ev3dev.py @@ -20,14 +20,12 @@ class Image: # is generated. @overload - def __init__(self, /, source: Union[Image, ImageFile, str]): - ... + def __init__(self, /, source: Union[Image, ImageFile, str]): ... @overload def __init__( self, /, source: Image, sub: Literal[False], x1: int, y1: int, x2: int, y2: int - ): - ... + ): ... def __init__(self, *args): """Image(source, sub=False) diff --git a/src/pybricks/messaging.py b/src/pybricks/messaging.py index dfbfda6..32fdfa9 100644 --- a/src/pybricks/messaging.py +++ b/src/pybricks/messaging.py @@ -103,7 +103,9 @@ class BLERadio: ``int``, ``float``, ``str``, or ``bytes``. """ - def observe(self, channel: int) -> Optional[ + def observe( + self, channel: int + ) -> Optional[ Union[ Tuple[Union[bool, int, float, str, bytes], ...], Union[bool, int, float, str, bytes], diff --git a/src/pybricks/nxtdevices.py b/src/pybricks/nxtdevices.py index a69d13a..7c38606 100644 --- a/src/pybricks/nxtdevices.py +++ b/src/pybricks/nxtdevices.py @@ -3,7 +3,6 @@ """Use LEGO® MINDSTORMS® NXT motors and sensors with the EV3 brick.""" - from .parameters import Port from ._common import ColorLight, CommonColorSensor diff --git a/src/ubuiltins/__init__.py b/src/ubuiltins/__init__.py index d2cd104..a98f56f 100644 --- a/src/ubuiltins/__init__.py +++ b/src/ubuiltins/__init__.py @@ -139,12 +139,10 @@ def bin(x: Any) -> _str: class bool: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, x: Any) -> None: - ... + def __init__(self, x: Any) -> None: ... def __init__(self, *args) -> None: """ @@ -166,20 +164,16 @@ class bool: class bytes: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, source: _int) -> None: - ... + def __init__(self, source: _int) -> None: ... @overload - def __init__(self, source: Union[_bytes, _bytearray, Iterable[_int]]) -> None: - ... + def __init__(self, source: Union[_bytes, _bytearray, Iterable[_int]]) -> None: ... @overload - def __init__(self, source: _str, encoding: _str) -> None: - ... + def __init__(self, source: _str, encoding: _str) -> None: ... def __init__(self, *args): r""" @@ -209,16 +203,15 @@ class bytes: class bytearray: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, source: _int) -> None: - ... + def __init__(self, source: _int) -> None: ... @overload - def __init__(self, source: Union[_bytes, _bytearray, _str, Iterable[_int]]) -> None: - ... + def __init__( + self, source: Union[_bytes, _bytearray, _str, Iterable[_int]] + ) -> None: ... def __init__(self, *args): r""" @@ -281,26 +274,22 @@ def classmethod(method: _callable) -> _callable: class complex: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload def __init__( self, real: Union[_float, SupportsFloat, _complex, SupportsComplex] - ) -> None: - ... + ) -> None: ... @overload def __init__( self, real: Union[_float, SupportsFloat, _complex, SupportsComplex], imag: Union[_float, SupportsFloat, _complex, SupportsComplex], - ) -> None: - ... + ) -> None: ... @overload - def __init__(self, value: _str) -> None: - ... + def __init__(self, value: _str) -> None: ... def __init__(self, *args) -> None: """ @@ -325,12 +314,10 @@ class complex: class dict: @overload - def __init(self) -> None: - ... + def __init(self) -> None: ... @overload - def __init(self, **kwargs) -> None: - ... + def __init(self, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: """ @@ -348,13 +335,11 @@ class dict: @overload -def dir() -> List[_str]: - ... +def dir() -> List[_str]: ... @overload -def dir(object: Any) -> List[_str]: - ... +def dir(object: Any) -> List[_str]: ... def dir(*args) -> List[_str]: @@ -376,13 +361,11 @@ def dir(*args) -> List[_str]: @overload -def divmod(a: _int, b: _int) -> Tuple[_int, _int]: - ... +def divmod(a: _int, b: _int) -> Tuple[_int, _int]: ... @overload -def divmod(a: _float, b: _float) -> Tuple[_float, _float]: - ... +def divmod(a: _float, b: _float) -> Tuple[_float, _float]: ... def divmod(a, b): @@ -407,12 +390,10 @@ def divmod(a, b): class enumerate: @overload - def __init__(self, iterable: Iterable) -> None: - ... + def __init__(self, iterable: Iterable) -> None: ... @overload - def __init__(self, iterable: Iterable, start: _int) -> None: - ... + def __init__(self, iterable: Iterable, start: _int) -> None: ... def __init__(self, *args) -> None: """ @@ -431,18 +412,15 @@ class enumerate: @overload -def eval(expression: _str) -> Any: - ... +def eval(expression: _str) -> Any: ... @overload -def eval(expression: _str, globals: _dict) -> Any: - ... +def eval(expression: _str, globals: _dict) -> Any: ... @overload -def eval(expression: _str, globals: _dict, locals: Mapping) -> Any: - ... +def eval(expression: _str, globals: _dict, locals: Mapping) -> Any: ... def eval(*args): @@ -468,18 +446,15 @@ def eval(*args): @overload -def exec(object: Any) -> None: - ... +def exec(object: Any) -> None: ... @overload -def exec(object: Any, globals: _dict) -> None: - ... +def exec(object: Any, globals: _dict) -> None: ... @overload -def exec(object: Any, globals: _dict, locals: Mapping) -> None: - ... +def exec(object: Any, globals: _dict, locals: Mapping) -> None: ... def exec(*args): @@ -503,20 +478,16 @@ def exec(*args): class float: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, x: _int) -> None: - ... + def __init__(self, x: _int) -> None: ... @overload - def __init__(self, x: SupportsFloat) -> None: - ... + def __init__(self, x: SupportsFloat) -> None: ... @overload - def __init__(self, x: _str) -> None: - ... + def __init__(self, x: _str) -> None: ... def __init__(self, *args) -> None: """float(x=0.0) @@ -529,13 +500,11 @@ class float: @overload -def getattr(object: Any, name: _str) -> Any: - ... +def getattr(object: Any, name: _str) -> Any: ... @overload -def getattr(object: Any, name: _str, default: Any) -> Any: - ... +def getattr(object: Any, name: _str, default: Any) -> Any: ... def getattr(*args): @@ -596,13 +565,11 @@ def hash(object: Any) -> _int: @overload -def help() -> None: - ... +def help() -> None: ... @overload -def help(object: Any) -> None: - ... +def help(object: Any) -> None: ... def help(*args) -> None: @@ -651,13 +618,11 @@ def id(object: Any) -> _int: @overload -def input() -> _str: - ... +def input() -> _str: ... @overload -def input(prompt: _str) -> _str: - ... +def input(prompt: _str) -> _str: ... def input(*args) -> _str: @@ -678,20 +643,16 @@ def input(*args) -> _str: class int: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, x: _str) -> None: - ... + def __init__(self, x: _str) -> None: ... @overload - def __init__(self, x: _str, base: _int) -> None: - ... + def __init__(self, x: _str, base: _int) -> None: ... @overload - def __init__(self, x: Union[_int, SupportsInt]) -> None: - ... + def __init__(self, x: Union[_int, SupportsInt]) -> None: ... def __init__(self, *args) -> None: """int(x=0) @@ -796,12 +757,10 @@ def len(s: Sequence) -> _int: class list: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, iterable: Iterable) -> None: - ... + def __init__(self, iterable: Iterable) -> None: ... def __init__(self, *args) -> None: """ @@ -852,13 +811,11 @@ def map(function: Callable, iterable: Iterable, *args: Any) -> Iterator: @overload -def max(iterable: Iterable) -> Any: - ... +def max(iterable: Iterable) -> Any: ... @overload -def max(arg1: Any, arg2: Any, *args: Any) -> Any: - ... +def max(arg1: Any, arg2: Any, *args: Any) -> Any: ... def max(*args): @@ -876,13 +833,11 @@ def max(*args): @overload -def min(iterable: Iterable) -> Any: - ... +def min(iterable: Iterable) -> Any: ... @overload -def min(arg1: Any, arg2: Any, *args: Any) -> Any: - ... +def min(arg1: Any, arg2: Any, *args: Any) -> Any: ... def min(*args): @@ -971,13 +926,13 @@ def pow(base: Union[_int, _float], exp: Union[_int, _float]) -> Union[_int, _flo @overload -def print(*objects): - ... +def print(*objects): ... @overload -def print(*objects, sep: _str = " ", end: _str = "\n", file: uio.FileIO = usys.stdin): - ... +def print( + *objects, sep: _str = " ", end: _str = "\n", file: uio.FileIO = usys.stdin +): ... def print(*args): @@ -999,16 +954,13 @@ def print(*args): class range: @overload - def __init__(self, stop: _int) -> None: - ... + def __init__(self, stop: _int) -> None: ... @overload - def __init__(self, start: _int, stop: _int) -> None: - ... + def __init__(self, start: _int, stop: _int) -> None: ... @overload - def __init__(self, start: _int, stop: _int, step: _int) -> None: - ... + def __init__(self, start: _int, stop: _int, step: _int) -> None: ... def __init__(self, *args) -> None: """ @@ -1056,13 +1008,11 @@ def reversed(seq: Sequence) -> Iterator: @overload -def round(number: _float) -> _int: - ... +def round(number: _float) -> _int: ... @overload -def round(number: _float, ndigits: _int) -> _float: - ... +def round(number: _float, ndigits: _int) -> _float: ... def round(*args): @@ -1090,12 +1040,10 @@ def round(*args): class set: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, iterable: Iterable[Hashable]) -> None: - ... + def __init__(self, iterable: Iterable[Hashable]) -> None: ... def __init__(self, *args) -> None: """ @@ -1249,44 +1197,31 @@ class set: A new set. """ - def __contains__(self, item: Hashable) -> bool: - ... + def __contains__(self, item: Hashable) -> bool: ... - def __len__(self) -> int: - ... + def __len__(self) -> int: ... - def __bool__(self) -> bool: - ... + def __bool__(self) -> bool: ... - def __gt__(self, other: set) -> bool: - ... + def __gt__(self, other: set) -> bool: ... - def __lt__(self, other: set) -> bool: - ... + def __lt__(self, other: set) -> bool: ... - def __ge__(self, other: set) -> bool: - ... + def __ge__(self, other: set) -> bool: ... - def __le__(self, other: set) -> bool: - ... + def __le__(self, other: set) -> bool: ... - def __eq__(self, other: set) -> bool: - ... + def __eq__(self, other: set) -> bool: ... - def __ne__(self, other: set) -> bool: - ... + def __ne__(self, other: set) -> bool: ... - def __sub__(self: _Self, other: set) -> _Self: - ... + def __sub__(self: _Self, other: set) -> _Self: ... - def __and__(self: _Self, other: set) -> _Self: - ... + def __and__(self: _Self, other: set) -> _Self: ... - def __or__(self: _Self, other: set) -> _Self: - ... + def __or__(self: _Self, other: set) -> _Self: ... - def __xor__(self: _Self, other: set) -> _Self: - ... + def __xor__(self: _Self, other: set) -> _Self: ... def setattr(object: Any, name: _str, value: Any) -> None: @@ -1306,16 +1241,13 @@ def setattr(object: Any, name: _str, value: Any) -> None: class slice: @overload - def __init__(self, stop: _int) -> None: - ... + def __init__(self, stop: _int) -> None: ... @overload - def __init__(self, start: _int, stop: _int) -> None: - ... + def __init__(self, start: _int, stop: _int) -> None: ... @overload - def __init__(self, start: _int, stop: _int, step: _int) -> None: - ... + def __init__(self, start: _int, stop: _int, step: _int) -> None: ... def __init__(self, *args) -> None: """ @@ -1355,14 +1287,12 @@ def staticmethod(method: _callable) -> _callable: class str: @overload - def __init__(self, object: Any = "") -> None: - ... + def __init__(self, object: Any = "") -> None: ... @overload def __init__( self, object: _bytes = b"", encoding: _str = "utf-8", errors: _str = "strict" - ) -> None: - ... + ) -> None: ... def __init__(self) -> None: """ @@ -1384,13 +1314,11 @@ class str: @overload -def sum(iterable: Iterable) -> _int: - ... +def sum(iterable: Iterable) -> _int: ... @overload -def sum(iterable: Iterable, start: _int) -> _int: - ... +def sum(iterable: Iterable, start: _int) -> _int: ... def sum(*args): @@ -1410,18 +1338,15 @@ def sum(*args): @overload -def super() -> _type: - ... +def super() -> _type: ... @overload -def super(type: _type) -> _type: - ... +def super(type: _type) -> _type: ... @overload -def super(type: _type, object_or_type: Any) -> _type: - ... +def super(type: _type, object_or_type: Any) -> _type: ... def super(*args): @@ -1440,12 +1365,10 @@ def super(*args): class tuple: @overload - def __init__(self): - ... + def __init__(self): ... @overload - def __init__(self, iterable: Iterable): - ... + def __init__(self, iterable: Iterable): ... def __init__(self, *args) -> None: """ diff --git a/src/uio/__init__.py b/src/uio/__init__.py index 1f8f6b4..04298e8 100644 --- a/src/uio/__init__.py +++ b/src/uio/__init__.py @@ -20,16 +20,13 @@ from typing import overload, Union class BytesIO: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, data: Union[bytes, bytearray]) -> None: - ... + def __init__(self, data: Union[bytes, bytearray]) -> None: ... @overload - def __init__(self, alloc_size: int) -> None: - ... + def __init__(self, alloc_size: int) -> None: ... def __init__(self, *args) -> None: """ @@ -57,16 +54,13 @@ class BytesIO: class StringIO: @overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @overload - def __init__(self, string: str) -> None: - ... + def __init__(self, string: str) -> None: ... @overload - def __init__(self, alloc_size: int) -> None: - ... + def __init__(self, alloc_size: int) -> None: ... def __init__(self, *args) -> None: """ diff --git a/src/urandom/__init__.py b/src/urandom/__init__.py index a2ff378..1039c9d 100644 --- a/src/urandom/__init__.py +++ b/src/urandom/__init__.py @@ -31,18 +31,15 @@ def seed(a: Optional[int] = None) -> None: @overload -def randrange(stop: int) -> int: - ... +def randrange(stop: int) -> int: ... @overload -def randrange(start: int, stop: int) -> int: - ... +def randrange(start: int, stop: int) -> int: ... @overload -def randrange(start: int, stop: int, step: int) -> int: - ... +def randrange(start: int, stop: int, step: int) -> int: ... def randrange(start, stop, step): diff --git a/src/uselect/__init__.py b/src/uselect/__init__.py index 9488b84..1f6200b 100644 --- a/src/uselect/__init__.py +++ b/src/uselect/__init__.py @@ -78,12 +78,10 @@ class Poll: """ @overload - def poll(self) -> List[Tuple[IO, int]]: - ... + def poll(self) -> List[Tuple[IO, int]]: ... @overload - def poll(self, timeout: int) -> List[Tuple[IO, int]]: - ... + def poll(self, timeout: int) -> List[Tuple[IO, int]]: ... def poll(self, timeout: int = -1, /) -> List[Tuple[IO, int]]: """ @@ -105,16 +103,13 @@ class Poll: """ @overload - def ipoll(self) -> Iterator[Tuple[IO, int]]: - ... + def ipoll(self) -> Iterator[Tuple[IO, int]]: ... @overload - def ipoll(self, timeout: int) -> Iterator[Tuple[IO, int]]: - ... + def ipoll(self, timeout: int) -> Iterator[Tuple[IO, int]]: ... @overload - def ipoll(self, timeout: int, flags: int) -> Iterator[Tuple[IO, int]]: - ... + def ipoll(self, timeout: int, flags: int) -> Iterator[Tuple[IO, int]]: ... def ipoll(self, timeout: int = -1, flags: int = 0, /) -> Iterator[Tuple[IO, int]]: """