MCPcopy
hub / github.com/waditu/tushare / encode_boolean

Method encode_boolean

tushare/util/demjson.py:3581–3583  ·  view source on GitHub ↗

Encodes the Python boolean into a JSON Boolean literal.

(self, bval, state)

Source from the content-addressed store, hash-verified

3579 return (kw == 'true')
3580
3581 def encode_boolean(self, bval, state):
3582 """Encodes the Python boolean into a JSON Boolean literal."""
3583 state.append( 'true' if bool(bval) else 'false' )
3584
3585 def decode_number(self, state):
3586 """Intermediate-level decoder for JSON numeric literals.

Callers 1

_do_encodeMethod · 0.95

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected