我有一组键值对,其中键是pandas时间戳,值是函数。现在我想知道在python中存储它的最有效方法是什么?对我来说最重要的是当我更新数据结构时,我希望它保持排序,即
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.event.issue.AbstractIssueEventListener;
import com.atlassian.jira.event.issue.IssueEvent;
import com.atlassian.jira.issue.link.IssueLinkType;
import com.atlassian.jira.bc.issue.link.IssueLinkService;
public class CopyComments extends AbstractIssueEventListener {
@Override
void workflowEvent(IssueEvent event) {
def commentManager = ComponentAccessor.getCommentManager();
def issueManager = ComponentAccessor.getIssueManager();
def comment = event.getComment();
ArrayList<String> linkedIssues = getLinkedEvents(event);
for (def i = 0; i < linkedIssues.size(); i++) {
def targetIssue = issueManager.getIssueObject(linkedIssues[i]);
commentManager.create(targetIssue, comment.authorApplicationUser, comment.body, true);
}
}
ArrayList<String> getLinkedEvents(IssueEvent event) {
}
}
只是更新字典会导致未排序的字典。我通过创建一个新的排序方法来解决这个问题,但每次都这样做有点笨拙,因为我可以在更新之前知道它已经是一个已排序的字典。 python中是否存在数据结构?或者我该如何建模?