def METHOD_NAME(self, package, partial):
    # Attention: this will typically recurse like addStep().
    key = "/".join(package.getStack())
    data = self.packages.get(key)
    if (data is None) or \
       (not partial and ((isinstance(data, bool) and data) or \
                         (not isinstance(data, bool) and PartialPackage.fromData(data).partial))):
        self.packages[key] = partial
        new = PartialPackage.fromPackage(package, self, partial)
        if self.packages[key] == partial:
            self.packages[key] = new.toData()
    return key