@@ -35,26 +35,26 @@ Synchronous queries
3535
3636Executes a q expression:
3737
38- >>> print q.sync(' til 10' )
38+ >>> print ( q.sync(' til 10' ) )
3939 [0 1 2 3 4 5 6 7 8 9]
4040
4141Executes an anonymous q function with a single parameter:
4242
43- >>> print q.sync(' {til x}' , 10 )
43+ >>> print ( q.sync(' {til x}' , 10 ) )
4444 [0 1 2 3 4 5 6 7 8 9]
4545
4646Executes an anonymous q function with two parameters:
4747
48- >>> print q.sync(' {y + til x}' , 10 , 1 )
48+ >>> print ( q.sync(' {y + til x}' , 10 , 1 ) )
4949 [ 1 2 3 4 5 6 7 8 9 10]
50- >>> print q.sync(' {y + til x}' , * [10 , 1 ])
50+ >>> print ( q.sync(' {y + til x}' , * [10 , 1 ]) )
5151 [ 1 2 3 4 5 6 7 8 9 10]
5252
5353The :class: `.QConnection ` class implements the
5454:func: `~qpython.qconnection.QConnection.__call__ ` method. This allows
5555:class: `.QConnection ` instance to be called as a function:
5656
57- >>> print q(' {y + til x}' , 10 , 1 )
57+ >>> print ( q(' {y + til x}' , 10 , 1 ) )
5858 [ 1 2 3 4 5 6 7 8 9 10]
5959
6060
@@ -84,25 +84,25 @@ For example:
8484- Retrieves query result along with meta-information:
8585
8686>>> q.query(qconnection.MessageType.SYNC ,' {x} ' , 10 )
87- >>> print q.receive(data_only = False , raw = False )
87+ >>> print ( q.receive(data_only = False , raw = False ) )
8888QMessage: message type: 2, data size: 13, is_compressed: False, data: 10
8989
9090- Retrieves parsed query result:
9191
9292>>> q.query(qconnection.MessageType.SYNC ,' {x} ' , 10 )
93- >>> print q.receive(data_only = True , raw = False )
93+ >>> print ( q.receive(data_only = True , raw = False ) )
949410
9595
96- >>> q.sync(' asynchMult:{[a;b] res:a*b; (neg .z.w)(res) }' );
96+ >>> q.sync(' asynchMult:{[a;b] res:a*b; (neg .z.w)(res) }' )
9797>>> q.async (' asynchMult' , 2 , 3 )
98- >>> print q.receive()
98+ >>> print ( q.receive() )
99996
100100
101101- Retrieves not-parsed (raw) query result:
102102
103103>>> from binascii import hexlify
104104>>> q.query(qconnection.MessageType.SYNC ,' {x} ' , 10 )
105- >>> print hexlify(q.receive(data_only = True , raw = True ))
105+ >>> print ( hexlify(q.receive(data_only = True , raw = True ) ))
106106fa0a000000
107107
108108
@@ -120,24 +120,25 @@ These methods accepts the `options` keywords arguments::
120120 >>> query = "{[x] 0Nd, `date$til x}"
121121
122122 >>> # retrieve function call as raw byte buffer
123- >>> print binascii.hexlify(q(query, 5, raw = True))
123+ >>> from binascii import hexlify
124+ >>> print(binascii.hexlify(q(query, 5, raw = True)))
124125 0e0006000000000000800000000001000000020000000300000004000000
125126
126127 >>> # perform a synchronous call and parse dates vector to numpy array
127- >>> print q.sync(query, 5, numpy_temporals = True)
128+ >>> print( q.sync(query, 5, numpy_temporals = True) )
128129 ['NaT' '2000-01-01' '2000-01-02' '2000-01-03' '2000-01-04' '2000-01-05']
129130
130131 >>> # perform a synchronous call
131132 >>> q.query(qconnection.MessageType.SYNC, query, 3)
132133 >>> # retrieve query result and represent dates vector as raw data wrapped in QTemporalList
133- >>> print q.receive(numpy_temporals = False)
134+ >>> print( q.receive(numpy_temporals = False) )
134135 [NaT [metadata(qtype=-14)] 2000-01-01 [metadata(qtype=-14)]
135136 2000-01-02 [metadata(qtype=-14)] 2000-01-03 [metadata(qtype=-14)]]
136137
137138 >>> # serialize single element strings as q characters
138- >>> print q.sync('{[x] type each x}', ['one', 'two', '3'], single_char_strings = False)
139+ >>> print( q.sync('{[x] type each x}', ['one', 'two', '3'], single_char_strings = False) )
139140 [ 10, 10, -10]
140141
141142 >>> # serialize single element strings as q strings
142- >>> print q.sync('{[x] type each x}', ['one', 'two', '3'], single_char_strings = True)
143- [10, 10, 10]
143+ >>> print( q.sync('{[x] type each x}', ['one', 'two', '3'], single_char_strings = True) )
144+ [10, 10, 10]
0 commit comments