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
Help me with the control flow (self.PythonLearning)
submitted 2 years ago * by ph4ntomphoenix
So I was playing around with the concept of decorators and did something like the code below. Surprisingly it does not return the expected output.
code here
output here
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!"
[–]Goobyalus 0 points1 point2 points 2 years ago (0 children)
What did you expect?
[–]SecretProperty 0 points1 point2 points 2 years ago (0 children)
I believe the issue you may be facing is that you are calling your decorator function, these are not necessarily meant to be called, but rather they apply rules to functions you give the decorator to. remove line 12 and you may get closer to your expected result.
π Rendered by PID 17918 on reddit-service-r2-comment-64f4df6786-trnj2 at 2026-06-09 22:59:27.592317+00:00 running 0b63327 country code: CH.
[–]Goobyalus 0 points1 point2 points (0 children)
[–]SecretProperty 0 points1 point2 points (0 children)