From: "Berger, Daniel" Date: 2004-12-09T01:59:57+09:00 Subject: Re: Pathname needs a makeover Tanaka Akira wrote: >> First of all, Python people discuss various points for a class for pathname. >> http://people.nl.linux.org/~gerrit/creaties/path/pep-xxxx.html > It may be interesting because some points you mention is disscussed. Definitely looks interesting. I'll take a look. >> A pathname is a string. Therefore, it should be a subclass of String > No. Various string operations are not suitable for pathname. > For example, Pathname.new("a") + Pathname.new("b") is Pathname.new("a/b"), > not Pathname.new("ab"). Then you redefine the methods that need it. > Also I want to distinct a pathname and a content of file. > For example, my library for HTML, HTree, has HTree.new(arg) method. > If arg is a string, arg is treated as HTML content. If arg is a pathname, > arg is opened and its content is parsed. Then, IMHO, you should use duck-typing rather than checking the class type. > pathname.open and pathname.read is required for polymorphic to URI. > If pathname and open-uri is in effect, uri.read and pathname.read can > be used polymorphically. I don't follow. Can you provide an example? >> - It should make private methods private. > Acceptable. List of methods? It looks like any method with a :nodoc: tag is meant to be private. Regards, Dan