Skip to content

Identical vertices are equal but not identical #148

@barraponto

Description

@barraponto

If you lookup the same vertex (or edge) twice:

V_a = graph.vertices.index.lookup(somelabel=someid).next()
V_b = graph.vertices.index.lookup(somelabel=someid).next()

Then they're considered equal:

V_a == V_b # true

But not identical:

V_a is V_b # false

A consequence of this behavior is that set([V_a, V_b]) will return a set with two equal elements although I would expect only one.

This comes from bulbs.element.Element implementing __eq__ but not __hash__.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions