Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created May 14, 2024 17:01
Show Gist options
  • Save mypy-play/6ae0250fe13de0584a554cbf09f71669 to your computer and use it in GitHub Desktop.
Save mypy-play/6ae0250fe13de0584a554cbf09f71669 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from enum import Enum
class StrEnum(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