[Python-ideas] Allow __len__ to return infinity

Ram Rachum ram.rachum at gmail.com
Tue Feb 25 11:02:15 CET 2014


I'd like to have some objects that return infinity from their __len__ 
method. Unfortunately the __len__ method may only return an int, and it's 
impossible to represent an infinity as an int. Do you think that Python 
could allow returning infinity from __len__?


Thanks,
Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140225/f0000099/attachment.html>


More information about the Python-ideas mailing list