You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strcount, find, index, rfind, and rindex all accept int, None, or any value implementing __index__ for the start/end parameters. PR #1109 improves the annotation from int to Optional[Int], but still neglects the __index__ protocol. Rather than proposing a typing.SupportsIndex ABC, @JelleZijlstra suggested that we wait until PEP 544 to deal with this.
Note that there is a similar problem with list and tuple, with the additional caveat that CPython 3.6 does not accept None values but the raised exception suggests that they are supposed to. This deserves a bugs.python.org report.
The text was updated successfully, but these errors were encountered:
str
count
,find
,index
,rfind
, andrindex
all acceptint
,None
, or any value implementing__index__
for the start/end parameters. PR #1109 improves the annotation fromint
toOptional[Int]
, but still neglects the__index__
protocol. Rather than proposing atyping.SupportsIndex
ABC, @JelleZijlstra suggested that we wait until PEP 544 to deal with this.Note that there is a similar problem with
list
andtuple
, with the additional caveat that CPython 3.6 does not accept None values but the raised exception suggests that they are supposed to. This deserves a bugs.python.org report.The text was updated successfully, but these errors were encountered: