mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-20 08:12:02 +00:00
fix black at prefix string (#6122)
* fix black at prefix string * Type -> type * Type unused
This commit is contained in:
parent
e1ec661d4e
commit
7a394411b7
|
@ -11,7 +11,7 @@ URL: https://en.wikipedia.org/wiki/Binary_prefix
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from enum import Enum, unique
|
from enum import Enum, unique
|
||||||
from typing import Type, TypeVar
|
from typing import TypeVar
|
||||||
|
|
||||||
# Create a generic variable that can be 'Enum', or any subclass.
|
# Create a generic variable that can be 'Enum', or any subclass.
|
||||||
T = TypeVar("T", bound="Enum")
|
T = TypeVar("T", bound="Enum")
|
||||||
|
@ -53,7 +53,7 @@ class SIUnit(Enum):
|
||||||
yocto = -24
|
yocto = -24
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_positive(cls: Type[T]) -> dict:
|
def get_positive(cls: type[T]) -> dict:
|
||||||
"""
|
"""
|
||||||
Returns a dictionary with only the elements of this enum
|
Returns a dictionary with only the elements of this enum
|
||||||
that has a positive value
|
that has a positive value
|
||||||
|
@ -68,7 +68,7 @@ class SIUnit(Enum):
|
||||||
return {unit.name: unit.value for unit in cls if unit.value > 0}
|
return {unit.name: unit.value for unit in cls if unit.value > 0}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_negative(cls: Type[T]) -> dict:
|
def get_negative(cls: type[T]) -> dict:
|
||||||
"""
|
"""
|
||||||
Returns a dictionary with only the elements of this enum
|
Returns a dictionary with only the elements of this enum
|
||||||
that has a negative value
|
that has a negative value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user