diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-06-11 04:05:22 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-06-11 04:05:22 +0000 |
commit | 380b36be3352cd9a5c93dbd67db25346166a8547 (patch) | |
tree | f69613e7b6238744c34af6dc14d6feb68a4f6706 /python | |
parent | 3905f9962bbfb312c3804ff9c7b7d1e0fa203cbc (diff) | |
download | libgats-380b36be3352cd9a5c93dbd67db25346166a8547.tar.gz libgats-380b36be3352cd9a5c93dbd67db25346166a8547.tar.bz2 libgats-380b36be3352cd9a5c93dbd67db25346166a8547.tar.xz libgats-380b36be3352cd9a5c93dbd67db25346166a8547.zip |
All languages now support Null except for python and php, python is proving
slightly trickier.
Diffstat (limited to 'python')
-rw-r--r-- | python/gats.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 ): | |||
146 | return 0.0 | 146 | return 0.0 |
147 | else: | 147 | else: |
148 | raise Exception('Invalid exceptional float subtype found.') | 148 | raise Exception('Invalid exceptional float subtype found.') |
149 | elif t == 'n': | ||
150 | return None | ||
149 | elif t == 'e': # End marker | 151 | elif t == 'e': # End marker |
150 | return None | 152 | return None |
151 | else: | 153 | else: |
@@ -153,7 +155,9 @@ def _readObj( sIn ): | |||
153 | return 'not implemented yet'; | 155 | return 'not implemented yet'; |
154 | 156 | ||
155 | def _writeObj( obj, sOut ): | 157 | def _writeObj( obj, sOut ): |
156 | if isinstance( obj, bool ): | 158 | if obj is None: |
159 | sOut.write('n') | ||
160 | elif isinstance( obj, bool ): | ||
157 | if obj == True: | 161 | if obj == True: |
158 | sOut.write('1') | 162 | sOut.write('1') |
159 | else: | 163 | else: |