Stefan Rank wrote: >> I suggest storing the first element separately from the rest of the path. >> The >> reason for suggesting this is that you use 'os.sep' to separate elements in >> the normal path, but *not* to separate the first element from the rest. > > I want to add that people might want to manipulate paths that are not > for the currently running OS. Therefore I think the `sep` should be an > attribute of the "root" element.
I meant to mention that. The idea I had was for normal path objects to use os.sep and os.extsep (so they can be pickled and unpickled successfully between platforms), and then have a mechanism that allowed a platform specific path to be selected based on the desired platform (i.e. one of the possible values of os.name: 'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos'). My inclination was to have a PlatformPath subclass that accepted 'os', 'sep' and 'extsep' keyword arguments to the constructor, and provided the appropriate 'sep' and 'extsep' attributes (supplying 'os' would just be a shortcut to avoid specifying the separators explicitly). That way the main class can avoid being complicated by the relatively rare need to operate on another platform's paths, while still supporting the ability. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com