-
-
Notifications
You must be signed in to change notification settings - Fork 263
Closed
Description
Describe the bug
ruff 0.15.0 throws these errors:
UP042 Class Product inherits from both `str` and `enum.Enum`
--> my_client/my_api_client/models/product.py:4:7
|
4 | class Product(str, Enum):
| ^^^^^^^
5 | CHEESE = "Cheese"
6 | MILK = "Milk"
|
help: Inherit from `enum.StrEnum`
UP046 Generic class `Response` uses `Generic` subclass instead of type parameters
--> my_client/my_api_client/types.py:45:16
|
44 | @define
45 | class Response(Generic[T]):
| ^^^^^^^^^^
46 | """A response from an endpoint"""
|
help: Use type parameters
after running ruff check --fix --unsafe-fixes the code looks like:
from enum import StrEnum
class Product(StrEnum):
CHEESE = "Cheese"
MILK = "Milk"and
@define
class Response[T]:
"""A response from an endpoint"""
status_code: HTTPStatus
content: bytes
headers: MutableMapping[str, str]
parsed: T | NoneReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels