1

The set function in Python relies on the existence of a robust equality operator existing on the elements given to set.

Suppose we had a list of floating point numbers, xs, and we called set(xs). How will set compare the elements of xs? Will it check to see if two elements are within machine epsilon, or will it perform bitwise equality?

bzm3r
  • 3,113
  • 6
  • 34
  • 67

0 Answers0