File: exception.pyi

package info (click to toggle)
mypy 1.19.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 22,412 kB
  • sloc: python: 114,754; ansic: 13,343; cpp: 11,380; makefile: 257; sh: 28
file content (30 lines) | stat: -rw-r--r-- 832 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
27
28
29
30
import sys
from typing import Generic, TypeVar
T = TypeVar('T')

class object:
    def __init__(self): pass

class type: pass
class tuple(Generic[T]):
    def __ge__(self, other: object) -> bool: ...
class list: pass
class dict: pass
class function: pass
class int: pass
class float: pass
class str: pass
class bool: pass
class ellipsis: pass

class BaseException:
    def __init__(self, *args: object) -> None: ...
class Exception(BaseException): pass
class RuntimeError(Exception): pass
class NotImplementedError(RuntimeError): pass

if sys.version_info >= (3, 11):
    _BT_co = TypeVar("_BT_co", bound=BaseException, covariant=True)
    _T_co = TypeVar("_T_co", bound=Exception, covariant=True)
    class BaseExceptionGroup(BaseException, Generic[_BT_co]): ...
    class ExceptionGroup(BaseExceptionGroup[_T_co], Exception): ...