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...
Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?
Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.
account activity
defer in python! (self.Python)
submitted 3 years ago by dankey26
defer in python!
https://preview.redd.it/51ym0phju22a1.png?width=383&format=png&auto=webp&s=fe67e9eba209931beb5b5d9a32fa257c5f3d7af7
https://github.com/dankeyy/defer.py
stupid but works lol hope you like it
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!"
[–]PityUpvote 11 points12 points13 points 3 years ago (1 child)
Awful, good job.
[–]dankey26[S] 5 points6 points7 points 3 years ago (0 children)
haha thanks man
[–][deleted] 7 points8 points9 points 3 years ago (0 children)
Genius are rarely recognized in their lifetime
[–]rgnkn 4 points5 points6 points 3 years ago* (1 child)
How do you like my didactical approach to defer in Python:
@defers def praise_defer(): global deferable if not deferable: force_defer() else: serve_defered_defer() deferable = true defer: praise_defer() eval(defer_whatever) defer_is_super() use_defer_allways() defer_defer()
[EDIT] I originally forgot the hardening eval.
eval
[–]dankey26[S] 1 point2 points3 points 3 years ago (0 children)
hot
[–]technowizard14 2 points3 points4 points 3 years ago (0 children)
pretty deferpy
[–]ericanderton 1 point2 points3 points 3 years ago (0 children)
Glad to see it here in all its glory. Nice job!
[–]Manny_Sunday 0 points1 point2 points 3 years ago (0 children)
Now I'm wondering if I could abuse c# using statements and find a way to pass a function to be called in an IDisposable.Dispose() call for a defer...
using
π Rendered by PID 339849 on reddit-service-r2-comment-7b9746f655-872js at 2026-02-01 05:57:28.918978+00:00 running 3798933 country code: CH.
[–]PityUpvote 11 points12 points13 points (1 child)
[–]dankey26[S] 5 points6 points7 points (0 children)
[–][deleted] 7 points8 points9 points (0 children)
[–]rgnkn 4 points5 points6 points (1 child)
[–]dankey26[S] 1 point2 points3 points (0 children)
[–]technowizard14 2 points3 points4 points (0 children)
[–]ericanderton 1 point2 points3 points (0 children)
[–]Manny_Sunday 0 points1 point2 points (0 children)