[Python-ideas] Getting file name of Path without suffix

Ram Rachum ram.rachum at gmail.com
Mon Jan 6 14:28:48 CET 2014


Hi guys,

What do you think about introducing this Path property:
     
    @property
    def suffixless_name(self):
        return self.name[:-len(self.suffix)] if self.suffix else self.name

It's simple but I'd really hate to have this conditional slicing in user 
code.


Thanks,
Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140106/ded8f64d/attachment.html>


More information about the Python-ideas mailing list