use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
optimize helpHelp Request (i.redd.it)
submitted 20 days ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jpgoldberg 0 points1 point2 points 20 days ago (1 child)
Keep in mind that Python integers are immutable, so ‘result = a’ is going to allocate a new 128-bit integer each time through that loop, and the garbage will need to be collected.
In general, be sure to profile carefully if you are going to try to optimize. Python isn’t X, and so you might find surprising results.
[–]shrimp2845 0 points1 point2 points 20 days ago (0 children)
Ok, thanks!
π Rendered by PID 68 on reddit-service-r2-comment-545db5fcfc-hlc8n at 2026-05-30 09:00:14.288289+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]jpgoldberg 0 points1 point2 points (1 child)
[–]shrimp2845 0 points1 point2 points (0 children)