Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit removed the item equals method from the internal method table. The equals method is an artifact that remained from copying from the typed-dict implementation. There it is needed, because indexing can be done with arbitrary key types and we need to be able to compare keys during insert and retrieval. Thus, the equals method is used in the C level code. For the list however, the equals method from the method table was never used in the c level code, simply because it was never needed there. Methods that do require a comparison of items such as count, remove and equals can (and do) do the comparison at the compiler level. Importantly however, enforcing that the items be comparable via an equals methods meant that types which are not comparable---such as jitclasses---could not be stored in the list and the initialization of the list failed in such cases, since the method table could not be setup. Now, they could be stored in principle. As a second step, it probably makes sense to implement a guard function that checks if a specific item type is comparable and then to use that guard in any list methods that require this, such as count, remove and equals.
- Loading branch information