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 deb_ctc
Recipients deb_ctc
Date 2021-06-07.04:56:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623041799.48.0.127398218724.issue44332@roundup.psfhosted.org>
In-reply-to
Content
numbers = [1, 2, 3, 4, 5, 6, 7, 8]
for x in numbers:
    print(x)
print(x)

In the above code, print(x) statement should give error. Because x scope should be local to for loop only.
99% cases, developers will not use the temporary variable x outside of the for loop.
So x will keep on consuming memory always. So it is a bad usage of memory.
Ideally x memory should be free once for loop execution is completed.
History
Date User Action Args
2021-06-07 04:56:39deb_ctcsetrecipients: + deb_ctc
2021-06-07 04:56:39deb_ctcsetmessageid: <1623041799.48.0.127398218724.issue44332@roundup.psfhosted.org>
2021-06-07 04:56:39deb_ctclinkissue44332 messages
2021-06-07 04:56:39deb_ctccreate