[Python-Dev] Why does read() return bytes instead of bytearray? (original) (raw)
Dan Eloff dan.eloff at gmail.com
Wed Apr 15 05:05:43 CEST 2009
- Previous message: [Python-Dev] Why does read() return bytes instead of bytearray?
- Next message: [Python-Dev] Why does read() return bytes instead of bytearray?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
No, the read() method did not change from the 2.x series. It returns a new object on each call.
I think you misunderstand me, but the readinto() method looks like a perfectly reasonable solution, I didn't realize it existed, as it's not in the library reference on file objects. Thanks for enlightening me, I feel a little stupid now :)
Python 3, lookout, here I come!
-Dan
- Previous message: [Python-Dev] Why does read() return bytes instead of bytearray?
- Next message: [Python-Dev] Why does read() return bytes instead of bytearray?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]