Skip to content

cmp solution does not work --> SyntaxError #297

@cclauss

Description

@cclauss

http://python-future.org/compatible_idioms.html?highlight=cmp#cmp recommends
cmp = lambda(x, y): (x > y) - (x < y) but that is a SyntaxError in Python 3.6...

python3 -c 'cmp = lambda(x, y): (x > y) - (x < y)' # --> SyntaxError

What is the correct approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions