File: types.py

package info (click to toggle)
django-choices-field 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: python: 464; sh: 18; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (2)
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
import enum
import sys
from typing import TYPE_CHECKING

from django.db import models
from typing_extensions import Self


class IntegerChoicesFlag(models.IntegerChoices, enum.Flag):
    """Enumerated integer choices."""

    if TYPE_CHECKING:

        def __or__(self, other: Self) -> Self: ...

        def __and__(self, other: Self) -> Self: ...

        def __xor__(self, other: Self) -> Self: ...

        def __invert__(self) -> Self: ...

        if sys.version_info >= (3, 11):
            __ror__ = __or__
            __rand__ = __and__
            __rxor__ = __xor__