RE: Python Libraries: Expanding the Functions

avatar

You are viewing a single comment's thread:

Sparse is the new shit!

Looks some fairly reasonable code up there. I have always been of the kind that writes small bits to get things done. One day I hope to get a bit pythony



0
0
0.000
6 comments
avatar

Voting on those one-liner Actifit posts would be embarrassing! I noticed some use AFIT and my code skips over those and votes.. DOH! I think I need to tweak it again.

0
0
0.000
avatar

You can check for intersections of sets to see if a post has any of a number of tags. I use that in proofofbrian.

if c.is_main_post() and tracktags.intersection(post['tags']) and author not in notified:
0
0
0.000
avatar

I will have a mess with this, otherwise it's back to looping!

0
0
0.000
avatar

tracktags is a set in that case. Otherwise I'd need nested loops to check all the combinations. I will use loops in some cases. I know there's a thing called 'code golf' where people try to implement something in as few characters as possible. That will end up with unreadable code. I try to make mine maintainable by others.

0
0
0.000
avatar

I know there's a thing called 'code golf' where people try to implement something in as few characters as possible.

I remember this from the Perl days.. crazy!

0
0
0.000
avatar

I know sometimes people make real posts on Actifit but I cant do it. There is so much dross that when Isee one I flee for the hills!

0
0
0.000