You are viewing a single comment's thread from:

RE: Part 13: Upvote Posts In Batches Based On Current Voting Power With Steem-Python

in #utopian-io7 years ago

Hey, I guess there are a few things that could be improved.

A dict is not a queue and not ordered. This means that the voter will not necessarily vote the posts in the same order they were added to the dict. If you want to maintain the order, use OrderedDict, list or multiprocessing.queue. If you're fine with any order, then calling it a "queue" is a little misleading.

For the VP calculation: .seconds will give wrong results if the time difference is larger than a day. Use .total_seconds() instead. voting_power() as shown here returns a string for <100% and an integer for =100%. Things like starting the voter at >80% VP for example get nasty with this implementation.

Additionally, you should really look into the datetime package. Converting a timediff to string to extract hours and minutes is not the most elegant way :)

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.030
BTC 57889.68
ETH 2457.18
USDT 1.00
SBD 2.40