Greg Ewing <[EMAIL PROTECTED]> wrote: >> Similarly, I would separate out the extension to a distinct >> attribute, as it too uses a different separator from the normal path >> elements ('.' most places, but '/' on RISC OS, for example) > > -1. What constitutes "the extension" is not well-defined in > all cases. What about filenames with multiple suffixes, > such as "spam.tar.gz"? What part of that would you put in > the extension attribute?
.gz of course: Path = "foo.tar.gz" Path.ext = ".gz" Path.name.ext = ".tar" Path.name.name.ext = "" Which is exactly the *same* thing that os.path.splitext() does. And yes, I do use splitext quite a lot. Giovanni Bajo _______________________________________________ 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