25 Jan
2006
25 Jan
'06
9:05 p.m.
John J Lee wrote:
On Tue, 24 Jan 2006, Ian Bicking wrote: [...]
Losing .open() would make it much harder for anyone wanting to write, say, a URI library that implements the Path API.
[...]
Why? Could you expand a bit?
What's wrong with urlopen(filesystem_path_instance) ?
My example shows this more clearly I think: def read_config(path): text = path.open().read() ... do something ... If I implement a URI object with an .open() method, then I can use it with this function, even though read_config() was written with file paths in mind. But without it that won't work: def read_config(path): text = open(path).read() ... -- Ian Bicking / ianb@colorstudy.com / http://blog.ianbicking.org