This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients Tommy.Carstensen, josh.r
Date 2014-03-24.21:44:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395697479.54.0.242602626535.issue20992@psf.upfronthosting.co.za>
In-reply-to
Content
fileinput's semantics are heavily tied to lines, not bytes. And processing binary files byte by byte is rather inefficient; can you explain why this feature would be of general utility such that it would be worth including it in the standard library?

It's not hard to just get a byte at a time using existing parts:

    def bytefileinput():
        return (bytes((b,)) for line in fileinput.input() for b in line)

There are ways to do similar things without using fileinput at all. But it really depends on your use case.

Giving fileinput a read() method isn't a bad idea assuming some reasonable behavior is defined for the various line oriented methods, but making it iterate binary mode input byte by byte would be a breaking change of limited utility in my view.
History
Date User Action Args
2014-03-24 21:44:39josh.rsetrecipients: + josh.r, Tommy.Carstensen
2014-03-24 21:44:39josh.rsetmessageid: <1395697479.54.0.242602626535.issue20992@psf.upfronthosting.co.za>
2014-03-24 21:44:39josh.rlinkissue20992 messages
2014-03-24 21:44:39josh.rcreate