Message95439
The actual file type rejects None in places like as the argument to read
or readlines. StringIO.StringIO, io.BytesIO, and io.StringIO all accept
None to mean the same as passing no argument at all.
This makes it tricky to write code that might operate on any of these
types (as many APIs accepting a "file-like object" try to). Testing
with one will not demonstrate that code works with any. In particular,
it's common to start test with StringIO, which is more liberal, and only
discover a problem when code is run for real against an actual file. |
|
Date |
User |
Action |
Args |
2009-11-18 19:01:54 | exarkun | set | recipients:
+ exarkun |
2009-11-18 19:01:54 | exarkun | set | messageid: <1258570914.64.0.211682819163.issue7349@psf.upfronthosting.co.za> |
2009-11-18 19:01:53 | exarkun | link | issue7349 messages |
2009-11-18 19:01:52 | exarkun | create | |
|