MCPcopy Index your code
hub / github.com/RustPython/RustPython / Queue

Class Queue

Lib/test/test_codecs.py:59–77  ·  view source on GitHub ↗

queue: write bytes at one end, read bytes from the other end

Source from the content-addressed store, hash-verified

57 return GetCPInfoEx(cp, 0, info)
58
59class Queue(object):
60 """
61 queue: write bytes at one end, read bytes from the other end
62 """
63 def __init__(self, buffer):
64 self._buffer = buffer
65
66 def write(self, chars):
67 self._buffer += chars
68
69 def read(self, size=-1):
70 if size<0:
71 s = self._buffer
72 self._buffer = self._buffer[:0] # make empty
73 return s
74 else:
75 s = self._buffer[:size]
76 self._buffer = self._buffer[size:]
77 return s
78
79
80class MixInCheckStateHandling:

Callers 10

check_partialMethod · 0.70
test_readlinequeueMethod · 0.70
test_copyMethod · 0.70
test_pickleMethod · 0.70
test_copyMethod · 0.70
test_pickleMethod · 0.70
test_copyMethod · 0.70
test_pickleMethod · 0.70
test_basicsMethod · 0.70
test_pickleMethod · 0.70

Calls

no outgoing calls

Tested by 10

check_partialMethod · 0.56
test_readlinequeueMethod · 0.56
test_copyMethod · 0.56
test_pickleMethod · 0.56
test_copyMethod · 0.56
test_pickleMethod · 0.56
test_copyMethod · 0.56
test_pickleMethod · 0.56
test_basicsMethod · 0.56
test_pickleMethod · 0.56