`_replace` returns a new value, it doesn't substitute the value in place. You need to assign this new value to `module.descriptor.scope_ids`. (See the docs for `namedtuple` for details)