Skip to content

Instantly share code, notes, and snippets.

@gnurag
Created March 14, 2014 09:14
Show Gist options
  • Select an option

  • Save gnurag/9544505 to your computer and use it in GitHub Desktop.

Select an option

Save gnurag/9544505 to your computer and use it in GitHub Desktop.
ujson lists
[anurag@dagobah ~]$ python
Python 2.7.5 (default, Feb 19 2014, 13:47:28)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from blist import blist
>>> from ujson import dumps
>>> a=range(10)
>>> a
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> b=blist(range(10))
>>> b
blist([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>>
>>> dumps(a)
'[0,1,2,3,4,5,6,7,8,9]'
>>> dumps(b)
'{}'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment