These are chat archives for praw-dev/praw

23rd
Mar 2018
bakonydraco
@bakonydraco
Mar 23 00:43
gah, how can this be
return Emoji(self.subreddit._reddit, self.subreddit, name.lower())
E TypeError: init() missing 3 required positional arguments: 'reddit', 'subreddit', and 'name'
it's right there
bakonydraco
@bakonydraco
Mar 23 00:56
@bboe any thoughts?
I've coded this every which way
confirmed that all 3 parameters are non-null
ahhhhh got it
I had an @property before the init
Joe RH
@jarhill0
Mar 23 01:04
That would do it :)
bakonydraco
@bakonydraco
Mar 23 01:09
worked through most of it
getting timeout errors now :(
Joe RH
@jarhill0
Mar 23 01:09
Which methods?
bakonydraco
@bakonydraco
Mar 23 01:12
haha it was because i was calling an emoji as a wikipage :D
Joe RH
@jarhill0
Mar 23 01:12
Interesting…!
bakonydraco
@bakonydraco
Mar 23 01:13
haha i fixed that, but the timeout is backj
      subreddit.emoji['test'].add('../../files/test.png')
praw/models/reddit/emoji.py:45: in add
self._reddit.post(url, data=data)
praw/reddit.py:445: in post
params=params)
praw/reddit.py:486: in request
params=params)
.eggs/prawcore-0.14.0-py3.6.egg/prawcore/sessions.py:182: in request
params=params, url=url)
.eggs/prawcore-0.14.0-py3.6.egg/prawcore/sessions.py:113: in _request_with_retries
data, files, json, method, params, retries, url)
.eggs/prawcore-0.14.0-py3.6.egg/prawcore/sessions.py:98: in _make_request
params=params)
.eggs/prawcore-0.14.0-py3.6.egg/prawcore/rate_limit.py:31: in call
self.delay()
.eggs/prawcore-0.14.0-py3.6.egg/prawcore/rate_limit.py:44: in delay
time.sleep(sleep_seconds)
Joe RH
@jarhill0
Mar 23 01:14
Let me play around with it. I'll let you know what I find.
bakonydraco
@bakonydraco
Mar 23 01:14
let me push all my code so far
Joe RH
@jarhill0
Mar 23 01:14
Alright, that would be nice!
I get a KeyError: 's3_key' after fixing the @property tag on __init__
bakonydraco
@bakonydraco
Mar 23 01:17
alright I think we're up to date
yeah I replaced that
the actual call is
s3_key = self._reddit.post(url, data=data)['s3UploadLease']['fields'][1]['value']
which i confirmed works
Joe RH
@jarhill0
Mar 23 01:19
I don't get any timeout error, but I don't get a successful result either
I'm running
subreddit.emoji['test'].add('../../files/test.png')
bakonydraco
@bakonydraco
Mar 23 01:20
yeah that's right, right?
i put it there at least
Joe RH
@jarhill0
Mar 23 01:20
That's what you gave me
bakonydraco
@bakonydraco
Mar 23 01:21
so why doesn't it work :D
well actually
like it looks like uploading to s3 works fine
it's the assignation that fails
adding is in 2 steps:
  1. upload image to s3
  1. assign image to subreddit
whoa the second i said 2, but it turned to 1
Joe RH
@jarhill0
Mar 23 01:21
Here's the problem: nowhere in your code actually uploads to s3 as far as I can tell.
bakonydraco
@bakonydraco
Mar 23 01:21
it does
i got a call and everything
Joe RH
@jarhill0
Mar 23 01:22

whoa the second i said 2, but it turned to 1

Yeah that's a markdown feature

Can you tell me which line uploads to S3?
All I see are two requests to Reddit.
bakonydraco
@bakonydraco
Mar 23 01:22
waaait i did it backwards
i think
emoji_upload should push to s3
emoji_lease for the subreddit
Joe RH
@jarhill0
Mar 23 01:23
I think your steps are ordered, it's just that you need a step to upload to s3
unless I'm misunderstanding the API workflow here
bakonydraco
@bakonydraco
Mar 23 01:23
doesn't the reddit api call for lease do that
Joe RH
@jarhill0
Mar 23 01:23
my understanding is:
  1. Request a "key" to upload to S3 from Reddit
  2. Do the upload to S3
  3. Send another request to Reddit telling them to add the emoji
All you send as a parameter in the first request is the file path, not the file itself
bakonydraco
@bakonydraco
Mar 23 01:24
oh :O
step 2 is nowhere on the api page
unless i'm misunderstanding?
Joe RH
@jarhill0
Mar 23 01:25

I got my understanding from this section on the API page:

Acquire and return an upload lease to s3 temp bucket. The return value of this function is a json object containing credentials for uploading assets to S3 bucket, S3 url for upload request and the key to use for uploading. Using this lease the client will upload the emoji image to S3 temp bucket (included as part of the S3 URL).

I think I'm correct, but as always, I could be mistaken
bakonydraco
@bakonydraco
Mar 23 01:25
no i think you're right
but so how do i do the upload
Joe RH
@jarhill0
Mar 23 01:26
I don't know
bakonydraco
@bakonydraco
Mar 23 01:26
here's the full json from the lease
Joe RH
@jarhill0
Mar 23 01:26
I'll play around with it a little bit and get back to you
bakonydraco
@bakonydraco
Mar 23 01:26
{
's3UploadLease':{
'action':'//reddit-uploaded-emoji.s3-accelerate.amazonaws.com',
'fields':[
{
'name':'acl',
'value':'public-read'
},
{
'name':'key',
'value':'t5_h6aad/t2_12vm3jhg/4b69f8efdb5cf1003fccd9bf1026c1e93d0eb950'
},
{
'name':'X-Amz-Credential',
'value':'ASIAIR5K3ZZNRDM7OFHQ/20180323/us-east-1/s3/aws4_request'
},
{
'name':'X-Amz-Algorithm',
'value':'AWS4-HMAC-SHA256'
},
{
'name':'X-Amz-Date',
'value':'20180323T010401Z'
},
{
'name':'success_action_status',
'value':'201'
},
{
'name':'content-type',
'value':'image/png'
},
{
'name':'x-amz-storage-class',
'value':'STANDARD'
},
{
'name':'x-amz-meta-ext',
'value':'png'
},
{
'name':'policy',
'value':'eyJjb25kaXRpb25zIjogW3siYnVja2V0IjogInJlZGRpdC11cGxvYWRlZC1lbW9qaSJ9LCB7ImtleSI6ICJ0NV9oNmFhZC90Ml8xMnZtM2poZy80YjY5ZjhlZmRiNWNmMTAwM2ZjY2Q5YmYxMDI2YzFlOTNkMGViOTUwIn0sIHsiYWNsIjogInB1YmxpYy1yZWFkIn0sIHsieC1hbXotc3RvcmFnZS1jbGFzcyI6ICJTVEFOREFSRCJ9LCB7IngtYW16LWNyZWRlbnRpYWwiOiAiQVNJQUlSNUszWlpOUkRNN09GSFEvMjAxODAzMjMvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LCB7IngtYW16LWFsZ29yaXRobSI6ICJBV1M0LUhNQUMtU0hBMjU2In0sIHsieC1hbXotZGF0ZSI6ICIyMDE4MDMyM1QwMTA0MDFaIn0sIHsieC1hbXotc2VjdXJpdHktdG9rZW4iOiAiRlFvRFlYZHpFQ0VhRExUWHMwZjVER1dwbW1zSHh5SzNBOVYxSGR1amgzcXFkYk55SXF0SjYzTFJsZGYwbkJxL2ZmeldtcUN6aDA0eEdIVm9pQXBqc0NyTk1EU1FReDFWb1lCcU9HTm8yT3phZlhhSG82aEhLT1VqM2dGQUFCNGg2VVVDKy9XeUwvYXVtRW9NSVdjV1FQZ3dBQS9ybFR5bHN5QXUxVlNRZEJXODh0M2x6UnhQUnhqcXlEWlllb1RXWXFMYkd0VnB5S0J6eExJWDU5d2N3WkJDcDRXNTNvWGFWWDkveXJ2bDBGRDBsbWRxSXNuYlAwZHRwTktSaTRIc2dIZHAzUFlERUZvUC9CKzQ4VjZnKzZXYm1pbnVKaUtyenJCeVkzVEJNTG5yaGtHa0RsRXRHdUphVzV3WjRzbmJGb2hmRG00ZktVUVJKc2w3ZWYrUjdEamNOQVRoZTgrYlorUmdWVFo0bUJSMEEvNUpqWnFhT3NWR0ZxSzhNZTBqR1Blc0syY1hzSWJDbHlWcm4wR21CV3FWYURJY2R0WmlKSGhXdHBZWjNjYnJWQWErY01ZVTRuT3ZhbGtrNi9scnN3MVlPdHNaSXJ3WWI5RU5oekRrekw2QkxxbFB3RWNONGZPVy8xSSs5S2wycGszK1VPamVyK1JZNGcxRDJ0ckpuaVdBc08xYVd2RTczUGxUc0UvM0xqcW5MR1Ardks5SnhuM0kxYkNBUmc3cEJ6YzcwOWlNVGVmN0puRHJzK1E4cFNkQUFZdzZUdnN1bnVLNGc2bFhyN3BZcytMdWNnOGJOUnBqZ01vSEV1UW9uSTNSMVFVPSJ9LCB7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6ICIyMDEifSwgWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsIDAsIDY0MDAwXSwgeyJ4LWFtei1tZXRhLWV4dCI6ICJwbmcifSwgeyJjb250ZW50LXR5cGUiOiAiaW1hZ2UvcG5nIn1dLCAiZXhwaXJhdGlvbiI6ICIyMDE4LTAzLTIzVDAxOjA1OjAxWiJ9'
},
{
'name':'X-Amz-Signature',
'value':'f0df19c6bcc06fc8062bcdf6123d270973f083f6b58f57dbf2977ef322eab3df'
},
{
'name':'x-amz-security-token',
'value':'FQoDYXdzECEaDLTXs0f5DGWpmmsHxyK3A9V1Hdujh3qqdbNyIqtJ63LRldf0nBq/ffzWmqCzh04xGHVoiApjsCrNMDSQQx1VoYBqOGNo2OzafXaHo6hHKOUj3gFAAB4h6UUC+/WyL/aumEoMIWcWQPgwAA/rlTylsyAu1VSQdBW88t3lzRxPRxjqyDZYeoTWYqLbGtVpyKBzxLIX59wcwZBCp4W53oXaVX9/yrvl0FD0lmdqIsnbP0dtpNKRi4HsgHdp3PYDEFoP/B+48V6g+6WbminuJiKrzrByY3TBMLnrhkGkDlEtGuJaW5wZ4snbFohfDm4fKUQRJsl7ef+R7DjcNAThe8+bZ+RgVTZ4mBR0A/5JjZqaOsVGFqK8Me0jGPesK2cXsIbClyVrn0GmBWqVaDIcdtZiJHhWtpYZ3cbrVAa+cMYU4nOvalkk6/lrsw1YOtsZIrwYb9ENhzDkzL6BLqlPwEcN4fOW/1I+9Kl2pk3+UOjer+RY4g1D2trJniWAsO1aWvE73PlTsE/3LjqnLGP+vK9Jxn3I1bCARg7pBzc709iMTef7JnDrs+Q8pSdAAYw6TvsunuK4g6lXr7pYs+Lucg8bNRpjgMoHEuQonI3R1QU='
}
]
},
'websocketUrl':'wss://ws-03b996f54a2cf5cf5.wss.redditmedia.com/subreddit-emoji/t5_h6aad-t2_12vm3jhg?m=AQAA2VS0WkkDWskOCJGMc_wa2z1DcW8O9_mTY2Cub7NlJV9s14lD'
}
ahhh i get it
Joe RH
@jarhill0
Mar 23 01:45
So we have to make a request to an S3 url using the credentials provided in the request. I'm muddling around with it a bit and it doesn't work yet but I'll let you know as soon as I figure it out.
bakonydraco
@bakonydraco
Mar 23 01:46
the credentials are a bit tricky
there are lots of them haha
bakonydraco
@bakonydraco
Mar 23 01:53
the boto3 library seems promising
Joe RH
@jarhill0
Mar 23 01:54
It looks to me like boto3 is for using the S3 API if you are an S3 customer. In our case, Reddit is the customer, and we're just trying to upload an image to a specific URL. We should be able to do this without a library.
I'm finding it surprisingly difficult to find good documentation
bakonydraco
@bakonydraco
Mar 23 01:55
oh whew
yes :/
Joe RH
@jarhill0
Mar 23 01:55
I'm sure there's a spec somewhere
bakonydraco
@bakonydraco
Mar 23 01:55
so there's this in the lease
'action':'//reddit-uploaded-emoji.s3-accelerate.amazonaws.com'
i wouldn't be 100% positive there's a spec
ooh this?
maybe this?
last updated 2 years ago though…
bakonydraco
@bakonydraco
Mar 23 02:01
yeah i saw that
and it's all js :/
Joe RH
@jarhill0
Mar 23 02:02
Alright I have some ideas but I'm still playing around
bakonydraco
@bakonydraco
Mar 23 02:03
okay, i'm heading home
i found another python lib
which i don't think we should rule out
Joe RH
@jarhill0
Mar 23 02:32
Houston, we have a solution!
At least I think we do
I got a successful response
It works!
This S3 stuff is massively confusing. I'll share my proof of concept once I clean it up a little.
Joe RH
@jarhill0
Mar 23 03:11
Take a look at this @bakonydraco https:// gist.github.com/jarhill0/c8f74813b6452cbb999492c9cfc1c513
Joe RH
@jarhill0
Mar 23 03:17

It turns out it's not as hard as I thought it was. There are two main points here:

Reddit actually gives us all the parameters we need to use in our request. It's confusing because of the way they're structured, but it's really just a list of key-value pairs.

Because we have to make a request to somewhere other than reddit (S3) we need to reach through a bunch of private variables to grab the raw requests.Session object. We can't just import requests and carry on because that would break testing and maybe actual functionality.

I spent a while trying to find documentation, but really, Reddit gave us exactly what we need.
(Also, does that gist I posted make anyone else's gitter client wig out? On my screen the preview covers up a bunch of other stuff.)
There, I edited the link so that it no longer previews
bakonydraco
@bakonydraco
Mar 23 05:03
taking a look!!
also i saw your note on endswith, good call
bakonydraco
@bakonydraco
Mar 23 05:21
woohoo! got everything working except the delete
it's a 400 now
bakonydraco
@bakonydraco
Mar 23 05:30
hmmm i think i got it
Joe RH
@jarhill0
Mar 23 05:31
Let me know if you need help. I think I have an idea, but I'll let you figure it out yourself.
bakonydraco
@bakonydraco
Mar 23 05:32
i got it
i think
i was using a post
shoot!
i had the upload working but it's broken again
oh whoops, didn't clear the cassettes
i think i got it!!!
Joe RH
@jarhill0
Mar 23 05:36
https://github.com/praw-dev/praw/commit/a4ea5a51f8b06f6dbab02f362c40353f621a8983#diff-56df88cc722a8ec45d9303e3f33d8936R421 would be my hint about what I think needs to happen, but maybe you've figured that out :D
(suggesting you may need to make a similar change to the Reddit class…)
bakonydraco
@bakonydraco
Mar 23 05:38
ah i could do that, but i just ran it as a DELETE
like: self._reddit.request('DELETE',url)
this was the format used for unhighlighting modmail
it's not quite as OOP as building in the patch
so that could be a good thing to add
Joe RH
@jarhill0
Mar 23 05:39
you're gonna have line-length issues with my code
just saying :)

self._reddit.request('DELETE',url)

That should work just as well

bakonydraco
@bakonydraco
Mar 23 05:40
:D
why are lines 80 charrrr
bakonydraco
@bakonydraco
Mar 23 05:49
question: It will do something if you try to upload when a name is already in place, I'm not sure what though
and it probably won't be graceful
Joe RH
@jarhill0
Mar 23 05:49
I don't know — you might be able to just upload a file and replace the existing one.
I haven't tried
bakonydraco
@bakonydraco
Mar 23 05:49
haha we'll see
i think the tests will pass, and then it'll make testing quicker
so once the commit is accepted
how do i use this with praw?
does it wait until the next release, but i can pull it from github with pip?
Joe RH
@jarhill0
Mar 23 05:51
You could pull it from github with pip, but I think bboe will probably release a new version once this is merged, since he hasn't released a version since December.
Though of course that's up to him and I'm just speculating
bakonydraco
@bakonydraco
Mar 23 05:52
oh sweet
and how does pip work?
like how does pip know a new release is out?
Joe RH
@jarhill0
Mar 23 05:53
If you have PRAW installed the normal way (pip install praw), then you can just run pip install --upgrade praw
bakonydraco
@bakonydraco
Mar 23 05:54
no but like
when bboe does a release
how does pip know?
Also, why is python: Nightly an allowed failure in Travis CI
Joe RH
@jarhill0
Mar 23 05:56

pip pulls (by default) from https://pypi.org/

And there's a command to push a new relase to PyPI — something like python3 setup.py sdist upload

It's an allowed failure because it fails so much, I think
and its failures have nothing to do with PRAW
bakonydraco
@bakonydraco
Mar 23 05:57
ahhh got it
ah shoot i updated the test so i need to update the cassette
i think
Joe RH
@jarhill0
Mar 23 06:00
it depends on whether the test update changes the network requests
you might not need to in this case
bakonydraco
@bakonydraco
Mar 23 06:01
well haha i did
bakonydraco
@bakonydraco
Mar 23 06:06
what the heeeeck
Joe RH
@jarhill0
Mar 23 06:07
You have to mock sleep — you did it in one of your other tests
make sure to add a _ parameter to the test function
bakonydraco
@bakonydraco
Mar 23 06:08
ohhh
what does that do again?
and will i need to regen the cassette
and what does the _ parameter do
Joe RH
@jarhill0
Mar 23 06:10
mocking makes a "fake" version of a function, in this case, time.sleep(), which is changed in a key way (in this case, it doesn't actually sleep).
Whether or not you have to regen the cassette depends on whether all the requests were made that should have been made (I suspect not, but I don't know)
bakonydraco
@bakonydraco
Mar 23 06:11
why does it need to sleep?
Joe RH
@jarhill0
Mar 23 06:11
I don't know why the _ is necessary, but it is
bakonydraco
@bakonydraco
Mar 23 06:11
or pretend to sleep
and why did the test build just fine locally for me
GAH
Joe RH
@jarhill0
Mar 23 06:11
It probably sleeps to obey the rate limit
And I don't know why it was incosistent, sorry :/
bakonydraco
@bakonydraco
Mar 23 06:11
i had to remove mock because it wasn't used :D
Joe RH
@jarhill0
Mar 23 06:11
But that's frustrating
bakonydraco
@bakonydraco
Mar 23 06:12
now i gotta add it back
Joe RH
@jarhill0
Mar 23 06:14
Beautiful commit name!
Added mock sleep so Travis will stop mocking me.
bakonydraco
@bakonydraco
Mar 23 06:15
:D
travis passed
coveralls is so close
94% on emoji
caaaause i didn't test jpeg
Joe RH
@jarhill0
Mar 23 06:19
Almost there!
bakonydraco
@bakonydraco
Mar 23 06:20
which means i'm gonna need a new cassette...
bakonydraco
@bakonydraco
Mar 23 06:33
OMG IT ACTUALLY PASSED
AAHHHH :D
Joe RH
@jarhill0
Mar 23 06:33
Good work!
bakonydraco
@bakonydraco
Mar 23 06:34
so what happens now haha
Joe RH
@jarhill0
Mar 23 06:35
I'll read through everything and I'll probably suggest some changes. Bboe will probably do the same. Then, you might have to rewrite some tests (I hope not, since you've worked so hard on these!). Finally, bboe will merge it and you'll have your first contribution to PRAW!
bakonydraco
@bakonydraco
Mar 23 06:35
haha no worries, this is great
Joe RH
@jarhill0
Mar 23 06:36
Thank you for all of your hard work — you've been very determined about getting over each hurdle.
bakonydraco
@bakonydraco
Mar 23 06:37
haha it's been fun
i've used praw a fair bit as an end user, exciting to learn better how it works
Joe RH
@jarhill0
Mar 23 06:52
Hey @bakonydraco you were asking about installing praw from github and I just wanted to link this part of the README in case you haven't already seen it
That's the command to install the github version
Bryce Boe
@bboe
Mar 23 06:55
Good work @bakonydraco!
Super glad to see the the test coverage in place.
bakonydraco
@bakonydraco
Mar 23 06:58
woohoo!
Bryce Boe
@bboe
Mar 23 07:31
Took a look over everything. Really solid work. A few changes yet, but it's so close.
bakonydraco
@bakonydraco
Mar 23 07:32
wonderful!
Bryce Boe
@bboe
Mar 23 07:35
@jarhill0 again really great mentoring along the way.
high fives all around
bakonydraco
@bakonydraco
Mar 23 07:36
reviewing the edits
Bryce Boe
@bboe
Mar 23 07:37
Awesome. And I'm going to sleep. Goodnight.
bakonydraco
@bakonydraco
Mar 23 07:38
night!
Fisher
@fisherthewol
Mar 23 15:54
Hey, if I've got an instance of a subreddit, how do I check if it's an 18+ sub or not?
Bryce Boe
@bboe
Mar 23 16:27
I think it's subreddit.over_18 or subreddit.nsfw.
Ah it's .over18.
@fisherthewol
bakonydraco
@bakonydraco
Mar 23 17:16
going through these new edits now @bboe
I was playing around with the idea of just dropping emoji.py entirely, but I see your point that subreddit.py is quite long
in particular on remove, I was wondering which functionality makes more sense:
subreddit.emoji.remove('cake')
or
subreddit.emoji['cake'].remove()
if it's the former, the method should be in subredditemoji, otherwise it should be in emoji
Joe RH
@jarhill0
Mar 23 17:26
I think bboe said that both should be available @bakonydraco
one method can call the other.
bakonydraco
@bakonydraco
Mar 23 17:26
ah that makes sense
I've moved all the code to emoji.py, per request
the main thing i'm trying to figure is if you try to remove something that isn't there
how should that be handled
Bryce Boe
@bboe
Mar 23 20:22
@bakonydraco what does it do now?
If it raises a meaningful exception that is fine, we should simply make a test case for it.
If it's not meaningful, maybe we can make it meaningful.
@jarhill0 what I meant for remove is that it should be on only the emoji.
Add should be on the helper.
bakonydraco
@bakonydraco
Mar 23 20:50
okay great
@bboe i actually made both add and remove functional on both
bakonydraco
@bakonydraco
Mar 23 21:03
holy shit, pep8 policing declension :O :joy:
    D401: First line should be in imperative mood; try rephrasing (found 'Helper')
bakonydraco
@bakonydraco
Mar 23 21:24
@bboe, @jarhill0 fixed all nits, and passed Travis/coveralls again
bakonydraco
@bakonydraco
Mar 23 21:30
Remaining open-ended questions that I think are satisfied to spec for this PR are:
  1. What behavior should happen when you try to add an emoji that's already there? Currently it replaces it, which is to spec and inline with the web behavior.
  2. What behavior should happen when you try to remove an emoji that isn't there? Currently it effectively does nothing, but doesn't alert the user that it wasn't there. I don't think that's necessary.
  3. Emojis are case insensitive, as @bboe pointed out. This is to spec with reddit. I think it's a very silly choice, but there we are.
  4. The caching layer is added to SubredditEmoji, and I think works as expected. The cache is updated with add/remove, or called when forced.
  5. Add/remove are both currently callable from either Emoji or SubredditEmoji, I think these are both useful.
  6. I built a helper function for get that passes Travis CI, but want to make sure it's up to coding convention.
(last build failed travis, just have to reupload the cassette, doing now)
bakonydraco
@bakonydraco
Mar 23 21:39
yep, passed :)
bakonydraco
@bakonydraco
Mar 23 21:44
:partyparrot:!
Thanks @jarhill0 :)
Joe RH
@jarhill0
Mar 23 21:47
Good work!
Hey @bakonydraco, just so you know, the Emoji class gets a ._reddit attribute thanks to inheritance.:
In [4]: vars(emoji['lettuce'])
Out[4]: 
{'_fetched': False,
 '_info_params': {},
 '_reddit': <praw.reddit.Reddit at 0x1060c1b70>,
 'created_by': 't2_14g6bq9',
 'name': 'lettuce',
 'reddit': <praw.reddit.Reddit at 0x1060c1b70>,
 'subreddit': Subreddit(display_name=''),
 'url': 'https://emoji.redditmedia.com/090gxn2ienj01_t5_3nwlq/lettuce'}
bakonydraco
@bakonydraco
Mar 23 22:59
Oh nice! Is any of my code redundant then?
Also, I realized there is one comment I didn't address: there is currently no support for working with sitewide emoji
I don't know how necessary it is, since a non-admin can't add or remove
bakonydraco
@bakonydraco
Mar 23 23:11
But having the ability to fetch them might be worth it
Joe RH
@jarhill0
Mar 23 23:54
Yeah, that was what I meant — fetching, not adding or removing.
As for code redundancy, super(Emoji, self).__init__(reddit, _data) sets self._reddit. If you remove self.reddit = reddit and replace all instances of self.reddit with self._reddit you should be fine.