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/2007-March/071966.html below:

[Python-Dev] Proposal to revert r54204 (splitext change)

[Python-Dev] Proposal to revert r54204 (splitext change) [Python-Dev] Proposal to revert r54204 (splitext change)Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 15 06:19:39 CET 2007
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
More information about the Python-Dev mailing list

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