Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change builtin method signatures to be compatible with Sequence, at the expense of accuracy. #1107

Closed
wants to merge 1 commit into from

Commits on Mar 27, 2017

  1. Change builtin method signatures to be compatible with Sequence, at t…

    …he expense of accuracy.
    
    This may not be acceptable, but it's the best I could do. Essentially, some of the builtin types implementing Sequence have start/end or start/stop optional parameters that accept None, and others do not. list and tuple raise errors suggesting they accept None but actually do not. range does not take start/end at all. The others appear to accept slice-compatible values. Finally, slice accepts any type implementing __index__, suggesting that the typing module should have a SupportsIndex ABC.
    
    Depending on how seriously you take the note in the object.__index__ documentation, SupportsIndex might require __int__ as well as __index__.
    gwk committed Mar 27, 2017
    Configuration menu
    Copy the full SHA
    f737942 View commit details
    Browse the repository at this point in the history