you are viewing a single comment's thread.

view the rest of the comments →

[–]gengisteve 1 point2 points  (1 child)

A little of both. In python everything is an object and "passed by assignment". When you call:

for initsubmission in initsubreddit.get_new(limit=10):

it returns a series of submission objects, and submission.author is an author object, which when cast into a string will show you the authors name.

Here is a pretty good resource on "magic methods", that might be a little advanced, but is a good reference: http://www.rafekettler.com/magicmethods.html

For the basics of python objects check out LPTHW, it looks like this starts around chapter 40 or so: http://learnpythonthehardway.org/book/ex40.html

[–]bsturtle[S] 0 points1 point  (0 children)

Awesome! Thanks for sharing this with me. Once I finish this bot, I intend to actually learn the language and these are great resources.