Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 fixes #137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cldoc/nodes/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def __init__(self, cursor, comment):
self.type = Type(cursor.type, cursor=cursor)

def compare_same(self, other):
def cmp(a, b):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to submit a PR to do exactly this. Just wanted to note that the author has actually already defined this new cmp function. So instead of defining it here, just add an import at the top of the file,

from ..cmp import cmp

return (a > b) - (a < b)
return cmp(self.sort_index, other.sort_index)

# vi:ts=4:et