Baffled by readline module

Grant Edwards grant.b.edwards at gmail.com
Thu Mar 9 18:02:53 EST 2023


On 2023-03-09, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> On 2023-03-09, Cameron Simpson <cs at cskk.id.au> wrote:
>
>> [...]
>>>It finally dawned on me after seeing an example I found elsewhere that
>>>you don't call some module method to fetch the next user-entered line.
>>>
>>>You call the input() built-in.
>>
>> Ah. That's not overtly stated? [...reads...] Ah, there it is in the last 
>> sentence of the opening paragraph. Not quite as in-your-face as I'd have 
>> liked it.
>
> What threw me off the track for a while was that the sentence to which
> you refer says it affects the "prompts offered by input()". In my head,
> that means it changes the string that's printed on stdout before stuff
> is read from stdin. That's different that affecting the handling of
> user input read by input().
>
> It doesn't actually change anything about the prompts provided by
> input(). It changes the handling of the user input by input().
>
> I guess I read it too literally. I must spend too much time with
> computers.

Yeesh. What's _really_ embarassing is that I just stumbled across a
small test program with which I had apparently figured this out 10-12
years ago.  Must be about time to retire...

--
Grant


More information about the Python-list mailing list