This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients Camion, eric.smith, serhiy.storchaka, steven.daprano
Date 2017-12-10.01:31:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512869509.79.0.213398074469.issue32259@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with Camion that the error message is misleading, and not just for beginners. It threw me for a loop too, when I first read it.

Serhiy is right, the exception type cannot and should not be changed, but we can change the error message. I'm re-opening the ticket as an enhancement to improve the message.

Here's my suggestion:

TypeError: cannot unpack object ('Fraction' is not iterable)

There is no stability guarantees on error messages, so we can include it in 3.6 (and possibly older if desired).

By the way Camion, as interesting as your program to calculate the digits of pi is, in general it is better to cut the code down to the simplest version that demonstrates the problem. Something like this would demonstrate it equally as well:

def gen():
    yield 1

for x, y in gen():
    pass
History
Date User Action Args
2017-12-10 01:31:49steven.dapranosetrecipients: + steven.daprano, eric.smith, serhiy.storchaka, Camion
2017-12-10 01:31:49steven.dapranosetmessageid: <1512869509.79.0.213398074469.issue32259@psf.upfronthosting.co.za>
2017-12-10 01:31:49steven.dapranolinkissue32259 messages
2017-12-10 01:31:48steven.dapranocreate