You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.badges docstring says it returns users, but actually it just seems to return the badge object. Is this the intended behavior?
In [60]: so = stackexchange.Site('stackoverflow')
In [61]: so.badges?
Type: instancemethod
String Form:<bound method Site.badges of <stackexchange.Site object at 0x7fc1150b3210>>
File: /home/aaron/sandbox/Py-StackExchange/demo/build/bdist.linux-x86_64/egg/stackexchange/__init__.py
Definition: so.badges(self, ids=None, **kw)
Docstring: Returns the users with the badges with IDs.
In [62]: so.badges(22)
Out[62]: (<Badge 'Great Question' @ 7fc1150b3d90>)
The text was updated successfully, but these errors were encountered:
Fixed the documentation issue pointed out in issue #44, and various
implementation issues with the badge recipients methods (probably caused
by differences from API v1.x, although this is hard to verify now it is
offline).
Sorry for the late reply, thanks a lot for pointing this out to me. That is indeed a documentation issue, which I've fixed in the latest commit.
While digging into it, however, there were a few other issues with the badge methods which should now be fixed in the latest commit. If you want to get the recipients of a particular badge, you can use the recipients field of the Badge object, e.g. so.badge(22).recipients. Bear in mind this is an 'infinite' generator, so don't try and turn it into a list all at once. For something closer to the documented API endpoint, the Site#badge_recipients method returns a set of Badges as described here.
.badges docstring says it returns users, but actually it just seems to return the badge object. Is this the intended behavior?
The text was updated successfully, but these errors were encountered: