Re:Good fun with bad crypto
by teddyh on Thursday January 16, 2014 @02:13PM
(#7071785)
Seeing stuff like that makes me sad. This could be more simply be written as:
[ Parent
| on HN ]
Re:Good fun with bad crypto
by badman_ting on Thursday January 16, 2014 @03:07PM
(#7072164)
That doesn't strike me as a very worthwhile criticism of code.
Re:Good fun with bad crypto
by cratermoon on Thursday January 16, 2014 @04:42PM
(#7072742)
As written, the code will write the response string out immediately. The for x in version will block until end-of-input.
Er... no. No it absolutely wouldn't block until end-of-input.
If list comprehensions were being used to precompute the output and the whole list printed from (what you seem to be thinking of) then perhaps yes, but any of:
for x in sys.stdin:
...
or [... for x in sys.stdin]
(where ... is print(func(x)) as per the post)as per the GP post will print response strings as the input comes in.