On Tue, 27 Aug 2019 10:51:52 +0100 Paul Moore <[email protected]> wrote: > > For example, the numpy case might be covered completely by the JSON > module just adding supporting for types that provide an __index__ > method. So rather than needing a new protocol, an existing one might > be perfectly adequate. (Although I've not looked into this in any > great detail, so it's entirely likely I've missed something critical - > my point is mainly that with a proper use case, we can discuss > solutions in the context of a real requirement).
I suspect that __index__ might work for integer-like objects. But then you have to deal with other objects such as numpy.float32, numpy.bool_, etc. Regards Antoine. _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/APULMN77ZM3VEOYYTVYWXT2Z7ASVILUF/ Code of Conduct: http://python.org/psf/codeofconduct/
