MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __new__

Method __new__

lib/sqlalchemy/dialects/postgresql/bitstring.py:34–40  ·  view source on GitHub ↗
(cls, _value: str, _check: bool = True)

Source from the content-addressed store, hash-verified

32 _DIGITS = frozenset("01")
33
34 def __new__(cls, _value: str, _check: bool = True) -> BitString:
35 if isinstance(_value, BitString):
36 return _value
37 elif _check and cls._DIGITS.union(_value) > cls._DIGITS:
38 raise ValueError("BitString must only contain '0' and '1' chars")
39 else:
40 return super().__new__(cls, _value)
41
42 @classmethod
43 def from_int(cls, value: int, length: int) -> BitString:

Callers

nothing calls this directly

Calls 1

unionMethod · 0.45

Tested by

no test coverage detected