Skip to content

cmp solution does not work --> SyntaxError #297

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions