Skip to content

Large integers are strings in the response dictionary #247

Open

Description

@mgritter

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions