File: line_profiler_utils.pyi

package info (click to toggle)
python-line-profiler 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,256 kB
  • sloc: python: 8,119; sh: 810; ansic: 297; makefile: 14
file content (26 lines) | stat: -rw-r--r-- 697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import enum
try:
    from typing import Self  # type: ignore[attr-defined]  # noqa: F401
except ImportError:  # Python < 3.11
    from typing_extensions import Self  # noqa: F401


# Note: `mypy` tries to read this class as a free-standing enum
# (instead of an `enum.Enum` subclass that string enums are to inherit
# from), and complains that it has no members -- so silence that


class StringEnum(str, enum.Enum):  # type: ignore[misc]
    @staticmethod
    def _generate_next_value_(name: str, *_, **__) -> str:
        ...

    def __eq__(self, other) -> bool:
        ...

    def __str__(self) -> str:
        ...

    @classmethod
    def _missing_(cls, value) -> Self | None:
        ...