MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / rstrip

Method rstrip

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

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

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

Source from the content-addressed store, hash-verified

141 return BitString(super().lstrip(char), False)
142
143 def rstrip(self, char: str | None = "0") -> BitString:
144 """Returns a copy of the BitString with trailing characters removed.
145
146 If omitted or None, ``'char'`` defaults to "0"::
147
148 BitString("00010101000").rstrip() == BitString("10101000")
149 BitString("11110101111").rstrip("1") == BitString("10101111")
150 """
151 if char is None:
152 char = "0"
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

Callers 8

_log_noticesMethod · 0.80
_schema_elementsFunction · 0.80
_compose_select_bodyMethod · 0.80
visit_clauselistMethod · 0.80
visit_binaryMethod · 0.80
inject_param_textFunction · 0.80
test_string_methodsMethod · 0.80
_encode_glyphMethod · 0.80

Calls 1

BitStringClass · 0.85

Tested by 1

test_string_methodsMethod · 0.64