Skip to content

Commit b774d18

Browse files
committed
fix up "id" kwargs.
"status_id" is more common within the api, but there are a couple methods that use "id" to spec the same thing, which is confusing and inconsistent. "woeid" avoids shadowing a builtin, but is also more expressive.
1 parent 19e59b9 commit b774d18

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

twitter/api.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22

33
#
4-
# vim: sw=2 ts=2 sts=2
54
#
65
# Copyright 2007 The Python-Twitter Developers
76
#
@@ -490,9 +489,9 @@ def GetTrendsCurrent(self, exclude=None):
490489
Returns:
491490
A list with 10 entries. Each entry contains a trend.
492491
"""
493-
return self.GetTrendsWoeid(id=1, exclude=exclude)
492+
return self.GetTrendsWoeid(woeid=1, exclude=exclude)
494493

495-
def GetTrendsWoeid(self, id, exclude=None):
494+
def GetTrendsWoeid(self, woeid, exclude=None):
496495
"""Return the top 10 trending topics for a specific WOEID, if trending
497496
information is available for it.
498497
@@ -507,7 +506,7 @@ def GetTrendsWoeid(self, id, exclude=None):
507506
A list with 10 entries. Each entry contains a trend.
508507
"""
509508
url = '%s/trends/place.json' % (self.base_url)
510-
parameters = {'id': id}
509+
parameters = {'id': woeid}
511510

512511
if exclude:
513512
parameters['exclude'] = exclude
@@ -771,7 +770,7 @@ def GetStatus(self,
771770
return Status.NewFromJsonDict(data)
772771

773772
def GetStatusOembed(self,
774-
id=None,
773+
status_id=None,
775774
url=None,
776775
maxwidth=None,
777776
hide_media=False,
@@ -2810,7 +2809,7 @@ def LookupFriendship(self,
28102809

28112810
def CreateFavorite(self,
28122811
status=None,
2813-
id=None,
2812+
status_id=None,
28142813
include_entities=True):
28152814
"""Favorites the specified status object or id as the authenticating user.
28162815
@@ -2845,7 +2844,7 @@ def CreateFavorite(self,
28452844

28462845
def DestroyFavorite(self,
28472846
status=None,
2848-
id=None,
2847+
status_id=None,
28492848
include_entities=True):
28502849
"""Un-Favorites the specified status object or id as the authenticating user.
28512850

0 commit comments

Comments
 (0)