Michael Urman wrote:
> Who would rather see os.path.dropext(path)?

I'd like to see such a function, and also
maybe replaceext(path, new_ext). I often
end up coding things like these myself,
since indexing the result of splitext all
the time is rather ugly.

To round off the set, I suggest

    path.dropext(path)  # returns the base name
    path.getext(path)   # returns the extension
    path.replaceext(path, newext) # adds or replaces the extension

--
Greg
_______________________________________________
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

Reply via email to