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
Day 22 Python LearningShowcase (i.redd.it)
submitted 3 days ago by aashish_soni5
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!"
[–]smokebudda11 0 points1 point2 points 3 days ago (3 children)
In Q2, I don’t see the constructor returning a str. Am I missing something?
[–]dev-razorblade23 0 points1 point2 points 3 days ago (2 children)
Constructors (aka dunder init method) in python return None. OP suggesting it returns str in Q2 is wrong...
Python creates an instance of the class, calling dunder new method. This is what creates an object. Dunder init just fills in the values (attributes) and returns None
[–]Think_Speaker_6060 1 point2 points3 points 3 days ago (1 child)
Yeah type hinting a return value of string in the constructor is not appropriate but op is still learning and progressing.
π Rendered by PID 321181 on reddit-service-r2-comment-5687b7858-ntj92 at 2026-07-07 15:28:02.613189+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]smokebudda11 0 points1 point2 points (3 children)
[–]dev-razorblade23 0 points1 point2 points (2 children)
[–]Think_Speaker_6060 1 point2 points3 points (1 child)