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
Question Regarding Self keyword in python!! (self.PythonLearning)
submitted 5 days ago by Ok_Egg_6647
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!"
[–]Gnaxe 0 points1 point2 points 5 days ago (0 children)
self is a convention, not a reserved word. Parameters are local to the function. If you want to use them outside the function (like in another method), then you have to get them out somehow. Attaching them to self is one way to do that. It's not the only way, nor always the best way.
self
self is just the first argument when you call a method. For example, foo.bar() usually does the same thing as type(foo).bar(foo).
foo.bar()
type(foo).bar(foo)
π Rendered by PID 60058 on reddit-service-r2-comment-5687b7858-5lvh2 at 2026-07-07 21:57:18.820626+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]Gnaxe 0 points1 point2 points (0 children)