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 at colorstudy.com / http://blog.ianbicking.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4