steemit / steem-python

The official Python (3) library for the Steem Blockchain.
https://steem.io
MIT License
153 stars 99 forks source link

Large integers are strings in the response dictionary #247

Open mgritter opened 6 years ago

mgritter commented 6 years ago

Version of Python you are running

3.5.2

Version of steem-python you are running

1.0.1 (from pypi)

Expected Behavior

Values in response dictionaries that are integers should be of integer type.

 {'percent': 10000,
  'reputation': 3112321478,
  'rshares': 58495538528,          ### int
  'time': '2018-06-10T02:35:09',
  'voter': 'particleman',
  'weight': 808},

Actual Behavior

Numbers which are too large (for standard JSON, I guess?) are returned as strings instead:

 {'percent': 10000,
  'reputation': 3112321478,
  'rshares': '58495538528',     ### string
  'time': '2018-06-10T02:35:09',
  'voter': 'particleman',
  'weight': 808},

Steps to reproduce

My example came from the response to

votes = s.get_active_votes( 'markgritter', 'standing-pat-when-you-re-not-the-favorite-in-triple-draw' )

For now I'm working around this by just wrapping int(x) around every response that might not be an int already.

Stack Trace

n/a