code: def extend_by(self, extension):
          
          copy = self[:]
          filename, _ = os.path.splitext(copy)
          return self.__class__('%s.%s' % (filename, extension.lstrip('.')))
docs: The path to the file changed to use the given extension
  
          >>> FilePath('/path/to/fred').extend_by('.txt')
          <FilePath '/path/to/fred.txt'>
          >>> FilePath('/path/to/fred.txt').extend_by('..tmp')
          <FilePath '/path/to/fred.tmp'>
          >>> FilePath('/path/to/fred.txt').extend_by('fred')
          <FilePath '/path/to/fred.fred'>