MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/util/langhelpers.py:1730–1753  ·  view source on GitHub ↗
(
        cls,
        classname: str,
        bases: Tuple[Type[Any], ...],
        dict_: Dict[str, Any],
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

1728
1729class _IntFlagMeta(type):
1730 def __init__(
1731 cls,
1732 classname: str,
1733 bases: Tuple[Type[Any], ...],
1734 dict_: Dict[str, Any],
1735 **kw: Any,
1736 ) -> None:
1737 items: List[symbol]
1738 cls._items = items = []
1739 for k, v in dict_.items():
1740 if re.match(r"^__.*__$", k):
1741 continue
1742 if isinstance(v, int):
1743 sym = symbol(k, canonical=v)
1744 elif not k.startswith("_"):
1745 raise TypeError("Expected integer values for IntFlag")
1746 else:
1747 continue
1748 setattr(cls, k, sym)
1749 items.append(sym)
1750
1751 cls.__members__ = _collections.immutabledict(
1752 {sym.name: sym for sym in items}
1753 )
1754
1755 def __iter__(self) -> Iterator[symbol]:
1756 raise NotImplementedError(

Callers

nothing calls this directly

Calls 5

symbolClass · 0.85
itemsMethod · 0.45
matchMethod · 0.45
startswithMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected