Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created May 14, 2024 16:55
Show Gist options
  • Save mypy-play/523713f57cc341de1593dca3b96658df to your computer and use it in GitHub Desktop.
Save mypy-play/523713f57cc341de1593dca3b96658df to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from enum import Enum
class MyStrEnum(str, Enum):
A = "a" # ok
B = b"b", "utf-8" # ok, see the typeshed definition of `str.__new__`
C = "too", "many", "arguments", "provided" # runtime error: TypeError: str() takes at most 3 arguments (4 given)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment