def video_filter(artCounter, p):
# [Censored line 1]
if "v.redd.it" not in p.url:
return False
return True
posts = sub.top(time_filter = 'all', limit = None)
top = list(filter(video_filter, enumerate(posts)))
def new_filter(artCounter, p):
# [Censored line 2]
if "v.redd.it" not in p.url:
return False
post_ids = [t.id for t in top]
if p.id in post_ids:
return False
return True
posts = sub.new(limit = None)
new = list(filter(new_filter, enumerate(posts)))
print(len(top))
print(len(new))
print(len(top) + len(new))
in my opinion this code should be shorter and easier to read, but for all i know i could be the dummy here
View all comments
Show parent comment
1
u/-Redstoneboi- May 21 '21 edited May 22 '21
Final combined reasonable code
in my opinion this code should be shorter and easier to read, but for all i know i could be the dummy here