File: base.py

package info (click to toggle)
progressbar2 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,216 kB
  • sloc: python: 8,001; makefile: 155
file content (36 lines) | stat: -rw-r--r-- 572 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
31
32
33
34
35
36
from __future__ import annotations

import typing
from typing import IO, TextIO


class FalseMeta(type):
    @classmethod
    def __bool__(cls) -> bool:  # pragma: no cover
        return False

    @classmethod
    def __cmp__(cls, other: typing.Any) -> int:  # pragma: no cover
        return -1

    __nonzero__ = __bool__


class UnknownLength(metaclass=FalseMeta):
    pass


class Undefined(metaclass=FalseMeta):
    pass


assert IO is not None
assert TextIO is not None

__all__ = (
    'FalseMeta',
    'UnknownLength',
    'Undefined',
    'IO',
    'TextIO',
)