Replacing part of an object's name with object.name.replace? So this is a fairly straight forward thing I want to do. Basically I've got a mesh named XXXX_HP and I want it to find the "_HP" and replace that with "_LP"

I've looked through the various object.name functions and object.name.replace() seemed the most obvious to use, but it doesn't seem to do what I expected it to do. 

import bpy

bpy.context.object.name.replace("_HP", "_LP")
Replace is a string function that comes from python's string object.
Since an object's name is a string property class, that inherits some props and methods from python's built in string class, it also gets the replace method.

The string replace method doesn't replace in place, but returns a string with the replacement applied. Which means that what you actually need to do is:

bpy.context.object.name = bpy.context.object.name.replace("_HP", "_LP")