Terry Reedy schrieb: > "Brett Cannon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Why can't the fallback usage just pass the return value from __len__ to > bool() (forget the C function name) and return that result? It's just like > doing:: > > def bool(obj): > try: > return obj.__bool__() > except AttributeError: > return bool(len(obj)) > ------------ > > If an object without __bool__ returned itself as its length, this would be > an infinite loop, at least in this Python version. Do we worry about > something so crazy?
The length would have to be an integer, and this would have to be checked. Georg _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
