]> granicus.if.org Git - python/commit
bpo-36972: Add SupportsIndex (GH-13448)
authorPaul Dagnelie <paulcd2000@gmail.com>
Wed, 22 May 2019 14:23:01 +0000 (07:23 -0700)
committerIvan Levkivskyi <levkivskyi@gmail.com>
Wed, 22 May 2019 14:23:01 +0000 (15:23 +0100)
commit4c7a46eb3c009c85ddf2eb315d94d804745187d4
treeb6ffaec1dab471a445b59b6ab7d127afc347ac33
parent33e71e01e95506cf8d93fd68251fc56352bc7b39
bpo-36972: Add SupportsIndex (GH-13448)

In order to support typing checks calling hex(), oct() and bin() on user-defined classes, a SupportIndex protocol is required. The ability to check these at runtime would be good to add for completeness sake. This is pretty much just a copy of SupportsInt with the names tweaked.
Doc/library/typing.rst
Lib/test/test_typing.py
Lib/typing.py
Misc/ACKS
Misc/NEWS.d/next/Library/2019-05-20-17-08-26.bpo-36972.3l3SGc.rst [new file with mode: 0644]