Skip to content

Commit 200cff9

Browse files
committed
Merge pull request #40 from twitterdev/gpj_cursor_first
[improvement] adding .first to the cursor class
2 parents a590dcf + cf3e30b commit 200cff9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

twitter_ads/cursor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ def count(self):
4242
"""
4343
return self._total_count or len(self._collection)
4444

45+
@property
46+
def first(self):
47+
"""
48+
Returns the first item of available items available to the cursor instance.
49+
"""
50+
return next(iter(self._collection), None)
51+
4552
@property
4653
def fetched(self):
4754
"""

0 commit comments

Comments
 (0)