3 ms·
pexpect maintainer here. If this is any kind of criticism on the complexity of pexpect, then you're perfectly correct! Good job, pexpect is unfortunately too o
by jquast 11y ago
pexpect maintainer here. If this is any kind of criticism on the complexity of pexpect, then you're perfectly correct!
Good job, pexpect is unfortunately too old and widely adopted to go changing API for pythonic sake, its freshly due for a rewrite. Trying to mimic a tcl/expect pattern in python made for unpythonic patterns and user confusion. It was far less confusing in 2002 when most python developers had former experience in tcl/expect -- most people these days never heard of it.
I feel an expect replacement would best work with the asyncio.StreamReader and asyncio.StreamWriter interfaces, and allow expecting on multiple possible patterns and streams at the same time, using asyncio.wait_for -- which supplies its own timeout functionality, and of course interoperates with the asyncio event loop.
Making a python3 asyncio-only library might not be attractive for yesterday's python users, but it might ensure nobody will rewrite it all over again in another 12 years so!
- nastevens 11y agoI love the idea of integrating with asyncio, and it definitely makes sense to integrate it now while asyncio functionality is still fresh. I've added a tickler issue to the GitHub repo and you'll hopefully see it in 0.3. And thanks for the good work you do maintaining Pexpect. I wasn't kidding when I said I have gotten a LOT of mileage out of that library!