quangis / transforge

Describe processes as type transformations, with inference that supports subtypes and parametric polymorphism. Create and query corresponding transformation graphs.
GNU General Public License v3.0
2 stars 0 forks source link

Confusing behaviour of equality operator. #23

Open nsbgn opened 3 years ago

nsbgn commented 3 years ago

As it is, the equality operator can hold that v == o is false but o == v is true, if o is a type operation and v is a variable that is bound to o. This is confusing.

nsbgn commented 3 years ago

We should probably rename unifiable to match and remove the custom equality operator to alleviate this.

nsbgn commented 3 years ago

The above was done in 96a948a767f0bcb00439d3ff7d9a833b1e245c29.

nsbgn commented 3 years ago

Note also that __hash__, introduced in db95ab803daee953c1a0c3f451d48b3042040424, violates the principle that x == y implies hash(x) == hash(y), for the same reason. The main reason I haven't removed it yet is that is that equality is often used in testing. Should define an .assertMatch() instead of using .assertEqual().