Pyupgrade to Python 3.9 (#4718)

* Pyupgrade to Python 3.9

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2021-09-07 13:37:03 +02:00
committed by GitHub
parent 5d5831bdd0
commit cecf43d648
142 changed files with 523 additions and 530 deletions

View File

@ -3,11 +3,12 @@ Round Robin is a scheduling algorithm.
In Round Robin each process is assigned a fixed time slot in a cyclic way.
https://en.wikipedia.org/wiki/Round-robin_scheduling
"""
from __future__ import annotations
from statistics import mean
from typing import List
def calculate_waiting_times(burst_times: List[int]) -> List[int]:
def calculate_waiting_times(burst_times: list[int]) -> list[int]:
"""
Calculate the waiting times of a list of processes that have a specified duration.
@ -40,8 +41,8 @@ def calculate_waiting_times(burst_times: List[int]) -> List[int]:
def calculate_turn_around_times(
burst_times: List[int], waiting_times: List[int]
) -> List[int]:
burst_times: list[int], waiting_times: list[int]
) -> list[int]:
"""
>>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3])
[1, 3, 6]