isi-vista / immutablecollections

A library for immutable collections, in the spirit of Guava's Immutable Collections.
MIT License
3 stars 2 forks source link

Check classes implementing Sequence.__getitem__ for handling the slice case #19

Closed ConstantineLignos closed 5 years ago

ConstantineLignos commented 5 years ago

As in the example at https://github.com/python/mypy/issues/4108, the right way to implement __getitem__ is to implement overloads for the int and slice argument cases. We probably don't do this consistently, partly because we have disabled the warning (it used to be buggy).

So we need to do the following:

  1. Change the mypy filters in the makefile to let Signature of "__getitem__" errors through.
  2. Check every implementation of Sequence.__getitem__ to make sure we're doing it right.