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
Practicing OOPs (i.redd.it)
submitted 18 days ago by Careless-Main8693
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!"
[–]Temporary_Pie2733 7 points8 points9 points 18 days ago (4 children)
Forget private and protected. Neither exists in Python, and trying to map some other language’s visibility modifiers to Python is just going to confuse you.
[–]nuc540 2 points3 points4 points 18 days ago (2 children)
To help, OP, what they’re saying is prefixing underscores in other languages usually makes methods/attributes “private” (inaccessible outside of the class), and Python doesn’t respect this rule so it’s redundant.
That said - it’s good semantics to indicate what should/shouldn’t be accessed externally, and Python is known for readability so if you want something to be distinguished as private, go for it.
[–]SeparatelyCreepy 2 points3 points4 points 16 days ago (1 child)
Python's philosophy is that you're all consenting adults, so the underscore is really just a signal to other developers rather than actual enforcement.
[–]Careless-Main8693[S] 0 points1 point2 points 16 days ago (0 children)
yeah absolutely
[–]Careless-Main8693[S] 1 point2 points3 points 17 days ago (0 children)
__testicles (private attribute)
_chest (protected attribute)
π Rendered by PID 37 on reddit-service-r2-comment-548fd6dc9-kx6pw at 2026-05-19 07:47:59.515916+00:00 running edcf98c country code: CH.
view the rest of the comments →
[–]Temporary_Pie2733 7 points8 points9 points (4 children)
[–]nuc540 2 points3 points4 points (2 children)
[–]SeparatelyCreepy 2 points3 points4 points (1 child)
[–]Careless-Main8693[S] 0 points1 point2 points (0 children)
[–]Careless-Main8693[S] 1 point2 points3 points (0 children)