diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2021-09-01 04:28:42 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2021-09-01 04:28:42 -0400 |
commit | a8e75fe2696d9ae15cc7e0900ca3b22f5007d55c (patch) | |
tree | e899a0746b0650a16104e766871bd1f105680ce5 /docs/re | |
parent | 94d353f7d700c5a591d64d2b22613e04f52622b3 (diff) | |
download | lib-des-gnux-a8e75fe2696d9ae15cc7e0900ca3b22f5007d55c.tar.gz lib-des-gnux-a8e75fe2696d9ae15cc7e0900ca3b22f5007d55c.zip |
Add Convenience Utility to readuntil()
readuntil() and readlineuntil() will now automatically bind() a
predicate and given arguments to produce the single function predicate
required.
The 'until' module will provide convenience utilities for use with
readuntil() and readlineuntil(). For now, it contains functools.partial
renamed as bind(), lastline() which can call a predicate with the last
element of the array of lines given from readlineuntil(), and simplified
versions of re.search and re.fullmatch renamed as contains and equals.
These allow us to write powerful and legible statements like:
comm.readlineuntil(lastline,contains,b'Enter')
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to 'docs/re')
0 files changed, 0 insertions, 0 deletions