A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-August/016674.html below:

[Python-Dev] (Idea) subclassable string: path object?

[Python-Dev] (Idea) subclassable string: path object? [Python-Dev] (Idea) subclassable string: path object?Just van Rossum just@letterror.com
Fri, 3 Aug 2001 19:21:53 +0200
Guido van Rossum wrote:

> Two better solutions:
> 
> (1) If the Path class defines a __str__() method, you can write open(p).

Ah, I had no idea that works these days: excellent, much nicer!

> (2) You could add an open method to the Path class, and write p.open().

Mwah. I quite like (1). Maybe I'll just write a Path class and use it for a
while, then I can be more sure of it's usefulness (or unusefulness...).

I think it'll be a lot like string methods, in the sense that if all you know is
the string module string methods seems unneccesary and overkill, but once you
start using them you notice how much better it is. I see a Path object as an
attempt to OO-ify os.path. I'll report back if it works out well.

Just



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