MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / strip

Method strip

lib/sqlalchemy/dialects/postgresql/bitstring.py:155–165  ·  view source on GitHub ↗

Returns a copy of the BitString with both leading and trailing characters removed. If omitted or None, ``'char'`` defaults to ``"0"``:: BitString("00010101000").rstrip() == BitString("10101") BitString("11110101111").rstrip("1") == BitString("1010")

(self, char: str | None = "0")

Source from the content-addressed store, hash-verified

153 return BitString(super().rstrip(char), False)
154
155 def strip(self, char: str | None = "0") -> BitString:
156 """Returns a copy of the BitString with both leading and trailing
157 characters removed.
158 If omitted or None, ``'char'`` defaults to ``"0"``::
159
160 BitString("00010101000").rstrip() == BitString("10101")
161 BitString("11110101111").rstrip("1") == BitString("1010")
162 """
163 if char is None:
164 char = "0"
165 return BitString(super().strip(char))
166
167 def removeprefix(self, prefix: str, /) -> BitString:
168 return BitString(super().removeprefix(prefix), False)

Callers 15

run_fileFunction · 0.80
format_fileFunction · 0.80
get_identity_optionsMethod · 0.80
_show_create_tableMethod · 0.80
get_columnsMethod · 0.80
_get_column_infoMethod · 0.80
parse_fksMethod · 0.80
get_check_constraintsMethod · 0.80
_format_urlFunction · 0.80
safe_constructMethod · 0.80

Calls 1

BitStringClass · 0.85

Tested by 15

test_create_ddlMethod · 0.64
_assert_stmtsMethod · 0.64
_assert_stmtsMethod · 0.64
test_string_methodsMethod · 0.64
test_compile_typeMethod · 0.64
normalizeMethod · 0.64
test_thick_modeMethod · 0.64
setup_test_classMethod · 0.64
teardown_test_classMethod · 0.64
setup_test_classMethod · 0.64