MCPcopy Index your code
hub / github.com/python/cpython / set_terminator

Method set_terminator

Lib/test/support/asynchat.py:102–111  ·  view source on GitHub ↗

Set the input delimiter. Can be a fixed string of any length, an integer, or None.

(self, term)

Source from the content-addressed store, hash-verified

100 raise NotImplementedError("must be implemented in subclass")
101
102 def set_terminator(self, term):
103 """Set the input delimiter.
104
105 Can be a fixed string of any length, an integer, or None.
106 """
107 if isinstance(term, str) and self.use_encoding:
108 term = bytes(term, self.encoding)
109 elif isinstance(term, int) and term < 0:
110 raise ValueError('the number of received bytes must be positive')
111 self.terminator = term
112
113 def get_terminator(self):
114 return self.terminator

Callers 5

__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
_set_post_data_stateMethod · 0.80
smtp_DATAMethod · 0.80

Calls

no outgoing calls

Tested by 3

__init__Method · 0.64
__init__Method · 0.64
__init__Method · 0.64