For those copy-and-pasting, the change will be somewhat safer as
launchpad_object.self_link.replace('api.', '', 1).replace('/beta/', '/', 1)
For those copy-and-pasting, the change will be somewhat safer as
launchpad_ object. self_link. replace( 'api.', '', 1).replace( '/beta/ ', '/', 1)