Guido van Rossum added the comment: I'm -1 myself. I've rarely needed this -- if I wanted to know the size, I was almost always going to read the data into memory anyway, so why not just read it and then ask how much you got? For files on the filesystem there's os.path.getsize().
If I ever were to let this in, here's some more criticism: (a) the SizeInfo class is overkill. getsize() should just return an int. (b) getsize() should check self.seekable() first and raise the appropriate error if the file isn't seekable. (c) os.fstat() is much less likely to work than the tell-seek-tell-seek sequence, so why not use that everywhere? (d) people will expect to use this on text files, but of course the outcome will be in bytes, hence useless. ---------- nosy: +gvanrossum __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1351> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com