From 380b36be3352cd9a5c93dbd67db25346166a8547 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 11 Jun 2012 04:05:22 +0000 Subject: All languages now support Null except for python and php, python is proving slightly trickier. --- python/gats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/gats.py b/python/gats.py index 40139a2..22463ab 100644 --- a/python/gats.py +++ b/python/gats.py @@ -146,6 +146,8 @@ def _readObj( sIn ): return 0.0 else: raise Exception('Invalid exceptional float subtype found.') + elif t == 'n': + return None elif t == 'e': # End marker return None else: @@ -153,7 +155,9 @@ def _readObj( sIn ): return 'not implemented yet'; def _writeObj( obj, sOut ): - if isinstance( obj, bool ): + if obj is None: + sOut.write('n') + elif isinstance( obj, bool ): if obj == True: sOut.write('1') else: -- cgit v1.2.3